angularjs - Sort Table by the order of the Array not Alphabetical -


like in title mentioned want sort table order of array , not normal way -> alphabetical.

   array constants.     .constant("appconfig", {         "status": [             "in work",             "review",             "again in edit",             "finished"         ]     }) //in html standard code sorting atm alphabetical        <th>         <a href="#" ng-click="sorttype='status.status';sortreverse = !sortreverse">           status           <span ng-show="sorttype == 'status.status' && !sortreverse" class="fa fa-caret-down"></span>           <span ng-show="sorttype == 'status.status' && sortreverse" class="fa fa-caret-up"></span>         </a>         <select class="form-control" ng-model="select.status.status">           <option value="">-- select --</option>           <option ng-repeat='status in $ctrl.astatus' >{{status}}</option>         </select>       </th>       <tr dir-paginate="t in $ctrl.gettasks() | filter:{name:k}| orderby: sorttype:sortreverse| filter:select|itemsperpage: 10 results">      <td class="td-selects">                   <span uib-tooltip="{{t.notice}}" tooltip-popup-delay='500'>                   {{t.status.status}}</span>                 </td> 

so sorting
again in edit
finished
in work
review
, same in reverse. shall in "todo chain"->like in constant array be. this
in work
review
again in edit
finished
, reverse.
can somehow add $index or sort works that?

can create plunker/fiddle , post link same better understanding?


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -