I am trying to access the attributes of a directive in the controller function. However, by the time I access it, it is undefined. I noticed that if I do a simple timer it works
What works is, if you set
scope.text = $attrs.text;
inside the linking and the controller functions. This will only work initially, as there is no 2way- databinding. You can use $attrs.observe though.
See fiddle: http://jsfiddle.net/JohannesJo/nm3FL/2/