Angular filter exactly on object key

后端 未结 5 2067
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 12:35

I have a small angular app like so:

html


  
5条回答
  •  攒了一身酷
    2020-12-04 13:17

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

    //Suppose Object
    var users = [{
      "firstname": "RAM",
      "lastname": "KUMAR",
      "Address": "HOUSE NO-1, Example Street, Example Town"
      },
      {
      "firstname": "SHAM",
      "lastname": "RAJ K",
      "Address": "HOUSE NO-1, Example Street, Example Town"
    }]
    

    But you want to apply filter only on firstname

    
    

提交回复
热议问题