angularjs - Filter within ng-repeat -


i have object:

$scope.fields = {      id:                     'uid',     email:                  'mail',     housenumber:            'det.1',     streetone:              'det.2',     streettwo:              'det.3',     county:                 'det.4',     postcode:               'det.5',     daytimenumber:          'det.6',     firstname:              'det.7',     lastname:               'det.8',              fullname:               ['firstname', 'lastname'],     address:                ['housenumber', 'streetone', 'streettwo', 'county', 'postcode'],     mobile:                 'det.9',     subscribed:             'det.10',     yearofbirth:            'det.19',            model:                  'model',                 serial:                 'serial',     purchasedate:           'purchase_date',     registrationdate:       'registraition_date'  }; 

and array:

$scope.chosenfields = ['id', 'email', 'fullname', 'postcode', 'subscribed', 'address']; 

in html want show keys $scope.fields (e.g. model, serial, purchasedate) not in $scope.chosenfields array. this:

<ul>     <li ng-repeat="(key, value) in fields | filter:{checkfields:true}">{{key}}</li> </ul> 

and inside checkfields filter, don't call @ all. correct way of doing @ all?

if checkfields filter, way call

... | checkfields:true 

your current code calls angular filter filter, , passes argument following object

{     checkfields: true } 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -