@Component({
selector: 'app-my-component',
template: `
{{item.name}}
`,
})
export class MyComponent {
myObservable: Observable- ;
constructor(private myService: MyService) {
this.myObservable = this.myService.getItems();
}
}