0

I started to study AngularJS from the official tutorial and at a certain point, it use:

this.orderProp = 'age';

To give the possibility to order the list based on age. Now the question became inevitable:"What are the other properties? and where is the doc for orderProp" I tried to search it in API documentation without any success.

I supposed the orderProp was something related to the orderBy, but is not mentioned.

realnot
  • 721
  • 1
  • 11
  • 31
  • Can you post the exact spot in the documentation that you found that reference? This doesn't sound like something related to the API; rather, it sounds like an input somewhere on the page with `ng-model="orderProp"` defined on it. `orderProp` could be any valid JavaScript name. – Claies Oct 10 '17 at 14:45
  • Yes of course! Updated with the link. – realnot Oct 10 '17 at 15:13
  • 1
    That confirms my suspicion. in the HTML, the `ng-repeat` is filtered with `orderBy:$ctrl.orderProp`. `$ctrl` and `this` are interchangeable in this context, and `orderProp` could be any valid name. This also refers to the ` – Claies Oct 10 '17 at 15:16
  • 1
    in other words, `orderProp` wouldn't be documented in the API documentation because it's not part of the API, it is a property defined for this example. in your app, you could use any variable you like. – Claies Oct 10 '17 at 15:20
  • Ok, I got it. Thanks for the explanation! – realnot Oct 10 '17 at 15:27

0 Answers0