Despite my efforts to debug, I am still unable to pinpoint the mistake I am making in Angular.js.
I have been closely following the basic Angular tutorial at https://docs.angularjs.org/tutorial/step_03, where all examples run smoothly. However, I decided to experiment with some advanced features of Angular and added my own code to the step 3 examples.
Below are the links to the HTML and controller files:
index.html: https://gist.github.com/tario/f07239992eea75535421
controller.js https://gist.github.com/tario/1b6155b5c97e747abe32
The filter function is defined here: https://gist.github.com/tario/1b6155b5c97e747abe32#file-controllers-js-L16
However, when I try to enable the uppercase feature using the checkbox, I encounter the following error message:
Error: [$rootScope:infdig] 10 $digest() iterations reached. Aborting! Watchers fired in the last 5 iterations: [["fn: $watchCollectionWatch; newVal: 62; oldVal: 59"],["fn: $watchCollectionWatch; newVal: 65; oldVal: 62"],["fn: $watchCollectionWatch; newVal: 68; oldVal: 65"],["fn: $watchCollectionWatch; newVal: 71; oldVal: 68"],["fn: $watchCollectionWatch; newVal: 74; oldVal: 71"]] http://errors.angularjs.org/1.2.17/$rootScope/infdig?p0=10&p1=%5B%5B%22fn%3…20%24watchCollectionWatch%3B%20newVal%3A%2074%3B%20oldVal%3A%2071%22%5D%5D at at Scope.$get.Scope.$digest () at Scope.$get.Scope.$apply () at HTMLInputElement. () at at Array.forEach (native) at forEach () at HTMLInputElement.eventHandler ()
I am uncertain if the way I implemented the filter aligns with best practices. Can you help me understand why it's failing? All I intended to do was create a new array with transformed content from the initial array.