ng-repeat :filter by single field

后端 未结 12 2444
栀梦
栀梦 2020-11-22 10:06

I have an array of products that I\'m repeating over using ng-repeat and am using

<
12条回答
  •  北荒
    北荒 (楼主)
    2020-11-22 11:02

    Specify the property in filter, of object on which you want to apply filter:

    //Suppose Object
    var users = [{
      "firstname": "XYZ",
      "lastname": "ABC",
      "Address": "HOUSE NO-1, Example Street, Example Town"
    },
    {
      "firstname": "QWE",
      "lastname": "YUIKJH",
      "Address": "HOUSE NO-11, Example Street1, Example Town1"
    }]
    

    But you want to apply filter only on firstname

    
    

提交回复
热议问题