Hey again. So i am getting JSON remotely and showing it inside ion-list via ngFor loop. The problem is that i am getting duplicates. How could i make results unique?
Here is the code from my HTML file:
dbData will be downloaded locally and contain data for further operations of my app. I prefer having all this data in one local file more than having multiple files or remote calls which might make an app slower.
Depending on the data structure, you might look into filling up a Set object and you’ll have unique values automatically. Otherwise, your use case demands a Pipe I think.
Hm I see, yeah it might be an unreasonable burden on the view side. Then may be the data should come into the view already filtered somehow, so I think the OP should pre-process it. What would you suggest?
It actually was possible to do what you suggested in Angular 1, and a lot of people did. So you are in good company. But then people complained that Angular was slow, and it was because the pipe was “piping” every time the DOM was re-rendered, which happens a lot if change detection is on. So the Angular team removed that type of pipe from Angular 2, so programmers would not be tempted to do that anymore.