javascript - Start angular directive postlink function when DOM is ready -


I have instructions in my Angular code; there is a limited scope for the attributes of this element; Changing model controller; Postlink function designed to click on callback elements in the template; Template with ng-switch

  area: {payload: '='}, controller: function ($ radius) {$ scope.havePayload = $ scope.payload; }, Link: {post: function (scope, elm, ethers) {elem.children (". With-payload"). CSS ("background-color", "red"); }}, Restrict: 'A', Replace: Correct, Template: '& lt; = "Haplog" on the div ng-switch; \ & Lt; Div ng-switch-when = "true" class = "side-payload" & gt; & Lt; / Div & gt; \ & Lt; Div ng-switch-when = "false" class = "un-payload" & gt; & Lt; / Div & gt; \ & Lt; / Div & gt; ' 

The problem is that when the post link is started, the NG-switch still does not know anything about the model and I do not need to include it in the postal link. It is strange, because the postlink should be executed, when agreeing to the template model.
It looks strange, I know just my bad idea :) Update
(does not seem to work).


Comments