angularjs - $observe an object attribute of a directive -


There is a separate scope of my instruction and it receives an object from an attached controller as an attachment.

  App Directional ('Description', function () {return {restricted: 'e', ​​radius: {device: '= device', ...}, templateUrl: '/ details .html ', link: function scope, element, attrs) {attrs. $ Inspection ('device', function (value) {...});}};});  

and in HTML:

  & lt; Details Tool = 'ctrlAlias.device' ... & gt;  

I have read somewhere that if I want to check the change in the attribute, then I have to use the $ Inspection function. However, in most instances, I had only seen the use of $ inspection on primitive values ​​

I wonder if I can convert $ to device < How to show a property of / code>, device.exist (a boolean) and < attrs. Use device.id (a string) in $ ?

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -