I'm working with an array of objects that I want to filter. I had the idea to use Observables for this task. Can anyone confirm if this approach is correct?
export class MyClass
{
public item1: string;
public item2: string;
}
let myArray = MyClass[];
myArray.push({ item1: 'foo1', item2: 'bar1'})
myArray.push({ item1: 'foo2', item2: 'bar2'})
Observable.of(myArray)
.map(data => data.item1)
.subscrite(data => <<here there should be a list of strings here: ['foo1', 'foo2']>>)
Any insights on what might be missing or if this method is recommended?