still learning angularJS and was thinking about dynamic loading of templates or template urls like "template: vm.getTemplate()"
I tried to find out how I can use a controllers function in the components definition.
(function() {
'use strict';
angular
.module('trax')
.component('contentLoader', {
template: vm.getTemplate(),
bindings: {
},
controller: ContentLoaderController,
controllerAs: 'vm'
});
function ContentLoaderController(){
var vm = this;
vm.getTemplate = function getTemplate(){
return '<div>Example Template</div>'
}
}
})();
Regards, n00n