I am trying to derive data of my size from my component, but I can hardly figure out how to do this without a local template.
For various reasons, I need the markup to appear in the HTML file and not be parsed using js load
This is dummy code so far: (codepen: http://codepen.io/anon/pen/qNBBRN )
HTML:
<comp>
{{ $ctrl.testing }}
</comp>
Broken JS code:
angular
.module('Test', [])
.component('comp', {
controller: myCtrl,
});
function myCtrl() {
var model = this;
model.testing = '123';
}
document.addEventListener('DOMContentLoaded', function() {
angular.bootstrap(document, ['Test']);
});
And I want to avoid this, even if it works:
angular
.module('Test', [])
.component('comp', {
controller: myCtrl,
template: '{{ $ctrl.testing }}',
});
function myCtrl() {
var model = this;
model.testing = '123';
}
document.addEventListener('DOMContentLoaded', function() {
angular.bootstrap(document, ['Test']);
});
source
share