I'm using AngularJs, in creating a component I need to access the bindings in the controller of my component.
In html I'm calling the component like this:
<component type='tipo' urlid='meuid'></component>
I'm using the second syntax for bindigs:
bindings: {
type: '@',
urlid: '@'
}
And in the controller I'm using:
function meuController() {
var vm = this;
console.log(vm);
console.log(vm.type);
console.log(vm.urlid);
}
I'm having this comeback:
As you can see in the image the attributes then in the controller (vm) but when I access them I get the undefined
return.
How do I access these attributes?