Reputation: 115
<check_address address-id='address.addressId'></check_address> // html
app.directive('checkAddress', ['ajaxFactory', function (ajaxFactory) {
return {
restrict : 'EA',
scope:{
addressId : '='
},
templateUrl: 'address.html',
link: function (scope, elt ,attrs) {
console.log(scope.addressId);
}
};
}]);
Unable to get scope.addressId. It is showing undefined. But my value is present in scope. If anyone know means please update. Thanks in advance.
Upvotes: 1
Views: 63
Reputation: 28
app.directive('test', function(){
return {
restrict: 'A',
scope: {
myId: '@'
},
link: function(scope, iElement, iAttrs) {
iAttrs.$observe('myId', function(value){
alert(value);
});
}
};
});
Upvotes: 1