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
Post a Comment