Generating a container

This will inject a store into your component and create the component itself—the typical way to call this one is by typing:

ng generate container jedis

This will create the following files:

  • jedis.component.ts
  • jedis.component.html
  • jedis.component.css
  • jedis.component.spec.ts

And in jedis.component.ts and the store will be injected in the constructor, like so:

// jedis.component.tsimport { Component, OnInit } from '@angular/core';@Component({  selector: 'app-jedis',  templateUrl: './jedis.component.html',  styleUrls: ['./jedis.component.css']})export class JedisComponent implements OnInit {  constructor(private store: Store<any>) { } }  ngOnInit() {}}

Get Architecting Angular Applications with Redux, RxJS, and NgRx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.