1

I keep getting the following error:

Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations:

[[{"msg":"person.kind.match('customer')","newVal":["customer"],"oldVal":["customer"]}],[{"msg":"person.kind.match('customer')","newVal":["customer"],"oldVal":"<>"}],[{"msg":"person.kind.match('customer')","newVal":["customer"],"oldVal":"<>"}],[{"msg":"person.kind.match('customer')","newVal":["customer"],"oldVal":"<>"}],[{"msg":"person.kind.match('customer')","newVal":["customer"],"oldVal":"<>"}]]

The code which is causing this issue is below:

%p{ng: {if: "person.kind.match('partner')" } } Some text
.btn{ ng: { if: "person.kind.match('customer')" } } Some other text
  //more button here

I have looked at existing questions and all of them are different. My issue is caused by the match operator. How can I use the test operator here.

Note: I am not changing objects/models during the render of the view. I am just using the match operator

a131
  • 544
  • 3
  • 12

1 Answers1

1

So, it appears that the match operator was mutating the person.kind causing the 10 $digest() iterations reached error. I changed my implementation to use includes function instead of match operator to fix the issue.

a131
  • 544
  • 3
  • 12