2017-11-29 15 views
0

나는 다음과 같은 오류가 점점 계속 :

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":"<>"}]]

이 문제를 일으키는 코드는 다음과 같습니다 :

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

나는 기존의 질문에보고하고 그들 모두가 다른 . 내 문제는 일치 연산자 때문입니다. 여기서 테스트 연산자를 어떻게 사용할 수 있습니까?

참고 :보기를 렌더링하는 동안 개체/모델을 변경하지 않습니다. 일치 연산자를 사용 중입니다.

+0

PLS는 뷰 코드'.btn 년에 이미 당신의'match' 기능 –

+0

를 게시 {NG가 {경우 : "person.kind.match ('고객')"}} 일부 다른 텍스트 ' – xeon131

+1

이 의미 시계를 실행 한 결과가 후속 호출에서 새 값을 반환합니다 (바운드되는 함수는 거의 멱등하지 않습니다) – shaunhusain

답변

0

일치 연산자가 person.kind으로 변경되어 10 $digest() iterations reached 오류가 발생한 것 같습니다. match 연산자 대신 includes 함수를 사용하여 구현을 변경하여 문제를 해결했습니다.