I have been exploring a section of code related to filtering in AngularJS from the documentation website. (cf. http://docs.angularjs.org/api/ng.filter:filter)
Specifically, I am curious about the use of .$
appended to the object search
, as shown in the following lines:
24. Any: <input ng-model="search.$"> <br>
25. Name only <input ng-model="search.name"><br>
26. Phone only <input ng-model="search.phone"><br>
...
30. <tr ng-repeat="friendObj in friends | filter:search:strict">
While experimenting with a JSFiddle, I tried removing the .$
and found that the filtering still worked when text was inputted. This made me wonder why the .$
is needed at all if the search filter functions without it.
As a newcomer to AngularJS (and JavaScript in general), I am enjoying delving into this learning process. Any insights or guidance on this matter would be greatly appreciated.