I have an angularjs component, which has a template, a controller, some bindings, some transcluded parts.
I place this component in my DOM, together with its attributes:
<mycomponent attr1="x" attr2="y"></mycomponent>
These attributes values will be used by component's controller and/or in the component's template to be transcluded somewhere.
I need to run a function after the component has been completely created, i.e. it's template has been created on the DOM and all the transcluded elements have been given a value.
How can I accomplish that? I tried placing the function in the $postLink() hook of the controller, however when $postLink() fires I see that the transclusion has not run yet.
Moreover, I don't like to have to mess with component's controller, since the component is very general, I place it on several places in the DOM, and only ONE of them should run this function after its complete creation.