1
import { Store } from '@ngxs/store';

@Component({ ... })
export class ZooComponent {
animals$: Observable<string[]>;

constructor(private store: Store) {
this.animals$ = this.store.select(state => state.zoo.animals);
}
}

I'm working with ngxs/store however, I am getting the following error:

error TS2564: Property 'animals$' has no initializer and is not definitely assigned in the constructor.
Folky.H
  • 1,164
  • 4
  • 15
  • 37

0 Answers0