angularjs - Angular digest loop -


i have problem app because creates infinite loop cycle when trying generate form. form generated based on json (example in code). problem occurs when go step , go form. have no idea causes problem because happens when state loaded second time. possible angular keep watchers created in previous state , overlaps each other?

whole idea app have form definition in "form" section, there "schema" define each model element , @ end there "model" stores variables.

<schema-form     data-name     = "theemployeeform"     data-schema   = "$ctrl.json.all_fields.schema"     data-form     = "$ctrl.json.all_fields.form"     data-model    = "$ctrl.json.model"> </schema-form> 

to see error please open chrome inspector and: home -> form -> home -> form error: [$rootscope:infdig]

app example on plunker https://plnkr.co/edit/nkdzwlueo0rauzt1jpoj?p=preview

see if have created watch of own on property on scope, , trying modify value of property every time when watch gets executes below

var app = angular.module('test', []) app.controller('ctrl', function($scope) {   $scope.val = 100;    $scope.$watch('val',function(n,o){      $scope.val= $scope.val+1;   })  }); 

the above example creates infinite digest loop. digest loops gets executed maximum of 10 times , minimum of 2 times check if property has been changed in watch or not...basically dirty checking


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -