I'm trying to output my scope data from my component, but having a hard time figuring out how to do it without a local template.
For different reasons I need to have the markup ind the HTML file and not being parsed in with the js load
This is the dummy code so far: (codepen: http://codepen.io/anon/pen/qNBBRN)
HTML:
<comp>
{{ $ctrl.testing }}
</comp>
Non-working 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 this is what I want to avoid even though 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']);
});
controller: ['$scope', myCtrl] ... function myCtrl($scope)(){}