javascript - alternative method instead $watch in angularjs -


i have scope variable, when returns true, need trigger events or something. case, every first time, scope variable returns undefined , later returns true. in case used $watch method expected funcionality. there alternative approach same instead using $watch ?

 scope.$watch () ->     scope.initiatechild   , (value) ->     if value true       $timeout ->         scope.buildonboarding()       , 1000 

you can try using angularjs $on(), $emit() , $broadcast().

here example: http://www.binaryintellect.net/articles/5d8be0b6-e294-457e-82b0-ba7cc10cae0e.aspx


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -