Good morning everybody,
After lots of search about this subject, I could find how to get things bound, but I could not find a way to get the value from the component templateUrl.
Anyone knows how to get this value templateUrl from a component inside of $onInit of the associated controller?
Thank you all for your time!
That is my issue, my scope object i am getting empty for the templateUrl:
Component
let newComponent = {
templateUrl: 'components/new-component/template/field.html',
controller: TemplateController,
controllerAs: 'tr',
bindings: {
templateUrl: '<'
}
}
Controller
"use strict";
TemplateController.$inject = ['$scope','$element'];
// Controller Constructor
function TemplateController($scope, $element) {
// Creating the view model reference
let vm = this;
vm.$onInit = function () {
try {
console.log($scope.templateUrl);
debugger;
} catch (e) {
console.log(e);
}
}
}
export default TemplateController;