Last post Apr 18, 2016 06:44 PM by Khanna Gaurav
Apr 18, 2016 06:01 PM|sudip_inn|LINK
i am new in angular and i go through this doc
https://docs.angularjs.org/api/ng/directive/ngRepeat but do not understand the objective of track by clause using with ng-option.
<div ng-repeat="n in [42, 42, 43, 43] track by $index">
<div ng-repeat="n in [42, 42, 43, 43] track by myTrackingFunction(n)">
<div ng-repeat="model in collection track by model.id">
<div ng-repeat="obj in collection track by $id(obj)">
<div ng-repeat="model in collection | orderBy: 'id' as filtered_result track by model.id">
track by is something close to order by clause in sql ?
if yes then how can i specify sort order like ASC or DESC ?
in last code track by and orderBy both use....what they are doing. not clear what kind of output will come.
what is difference between orderBy & track by ?
orderBy is filter that i know. so track by is also a filter.
i know i am asking very basic question. basically posting here because things is not clear after reading it from doc. looking for some help and example to understand what track by does ?
how track by is different from orderby in terms of usage ?
Apr 18, 2016 06:44 PM|Khanna Gaurav|LINK
Following links have nice explanation of Track By