How can ...">

Assign pipe output in angular2 to variable

So I have a pipe like this:

<ul *ngFor="#eachNumber of (NumberArray | MyPipe: '1')"></ul> 

How can I assign the returned result of this process to a variable that can be used elsewhere in my code?

I searched for a while and read about something called assign-local, but couldn't find much information about this. Is there an obvious way to do this that I'm just missing?

+6
source share
2 answers

Just in case, someone came across this question. This is possible with Angular 4 with updated as syntax :)

+4
source
 NumberArray | MyPipe: '1' as result 
0
source

Source: https://habr.com/ru/post/1239028/


All Articles