I am trying to console.log myobject but I keep getting undefined. I tried using $scope.watch and $attrs.$observe. Can someone tell me what I'm doing wrong.
here is the html
<my-component some-data="$ctrl.data"></my-component>
here is the component and controller
module.component('myComponent', {
bindings: {
needThisStuff: '<someData'
},
controller: Ctrl,
templateUrl:
requirejs.toUrl('path/to/templ.html')
});
function Ctrl(){
var self = this;
console.log(self.needThisStuff);
}
how can I access needThisStuff using $watch or $observe or anything else, I am using angular 1.5
$ctrl.data, this is probably the issue. Component code is correct.$ctrl.data.