How can I obtain the result array of an angular “| filter” expression in a variable?

后端 未结 2 1357
灰色年华
灰色年华 2020-12-24 06:17

In angular, you can write filter expressions like



2条回答
  •  死守一世寂寞
    2020-12-24 06:36

    You can actually assign new variables to the scope in an angular expression. So the simplest solution would be to do

. filteredPhones is now a variable in the current scope - see this plnkr example.

提交回复
热议问题