I'm creating some directives with an isolated scope and some aliased properties. For example:
scope: {
prop1: '@'
}
My question is, when exactly to these aliases get added to the scope? I was running into some issues with the properties not being defined in my link function. Look in the console after running this jsFiddle: http://jsfiddle.net/rvd6x/.
When I try to get the property as normal it is not defined. If I try to get it later through a function (doStuff()) it is there. Or if I do a $timeout
with 0 it is there. Obviously I can workaround my issues by using the $timeout
, but I want to know why I can't just expect the scope to already have it right away in the link function. It'd be kind of a pain to have to inject $timeout
throughout all my directives.