javascript - Angularjs directive with function two way bound falling into infinite loop -


I have data with & lt; Select & gt; Trying to create a custom command to use the combo in this. The change function has passed to this instruction, and using the ng-change in the template, this function that calls the parent is within the scope, not in the separate director area . For example:

  app.directive ('select directive', function () {return {templateUrl: 'template / myTemplate.html', restrict: 'e', ​​is required: 'NgModel', scope: {Change: '=',} ...}  

This instruction is called as: & lt; select directive = " Myfunction () ">

As you can see, I am compelled to define the work within the parent circle, in two ways binding ( = ). It should be Because when this function goes to other select> gt; s, note that, within the parent's function, I use the instruction model to recover my ID.

My problem is that the work of parents is called, it falls in an infinite loop and I can not find any way. Any ideas?

Problems by wrapping the

function with the $ timeout service Solution. This function adds a cue Eue and execute once ready angular model also synchronized.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -