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
If you are accessing this value from your directive to insert in your view using a directive you can access this attribute using the $compile api and doing something like this