angularjs - angular function called before two way binding complete -


in custom angular directive i'm receiving method parameter. when user changes value in directive update directive's ngmodel , execute function.

apparently there usecase function passed uses ngmodel used directive. reason model doesn't update when function called, later.

is there way execute method once ngmodel's 2 way binding has taken place?

you check if ngmodel undefined in directive's update method.

function update(){   if(ngmodel !== undefined){     passedinfunction();   } } 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -