6

I am studying the angularJS home page samples and I came across the following usage of the angularJS ng-repeat directive:

 <tr ng-repeat="project in projects | filter:search | orderBy:'name'">

Is the pipe character an angularJS keyword or a plain JS keyword? Also, what is the desired effect of this keyword?

2 Answers 2

6

The pipe character has special meaning in AngularJS expression language and is used to invoke filters.

In short: this is AngularJS keyword to invoke filters.

3

It's an Angular keyword/symbol which is used when you want to apply some Angular filter to the input. In this case you may read the expression as follows:

  1. Take projects collection,
  2. Apply search filter on it,
  3. Than take the result of the search filter and apply the orderBy filter on it,
  4. Than take the result of the orderBy filter and feed it to ng-repeat
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.