platform icon indicating copy to clipboard operation
platform copied to clipboard

Walkthrough

Open stefaanderoeck opened this issue 2 years ago • 1 comments

Information

Following the walkthrough at https://ngrx.io/guide/store/walkthrough does not yield a working end result.

Starting from https://ngrx.io/generated/live-examples/ngrx-start/stackblitz.html and following the instructions results in errors. The link to the already completed example https://ngrx.io/generated/live-examples/store-walkthrough/stackblitz.html however does work correctly.

The difference is in extra import statements in 'app.module.ts', more specifically sections

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClient, HttpClientModule } from '@angular/common/http';

and

import { AppComponent } from './app.component';
import { BookListComponent } from './book-list/book-list.component';
import { BookCollectionComponent } from './book-collection/book-collection.component';

are not mentioned.

I would suggest to add these in the walkthrough at the appropriate places, such that this tutorial can readily be used by beginners as well.

Documentation page

https://ngrx.io/guide/store/walkthrough

I would be willing to submit a PR to fix this issue

  • [ ] Yes
  • [ ] No

stefaanderoeck avatar Aug 19 '22 14:08 stefaanderoeck

Good catch @stefaanderoeck , feel free to create a PR with the needed changes.

timdeschryver avatar Aug 19 '22 16:08 timdeschryver

I'd like to take this one if that's ok?

jrstrayhorn avatar Oct 01 '22 15:10 jrstrayhorn

Sure @jrstrayhorn! :)

markostanimirovic avatar Oct 01 '22 16:10 markostanimirovic

@markostanimirovic - I noticed the store walkthrough app didn't work without CommonModule (b/c of ngFor and async pipe) so added instruction around that as well as addressing the missing imports. Plus removed HttpClient import from app.module.ts as it's not needed.

jrstrayhorn avatar Oct 02 '22 00:10 jrstrayhorn

@markostanimirovic - I noticed the store walkthrough app didn't work without CommonModule (b/c of ngFor and async pipe) so added instruction around that as well as addressing the missing imports. Plus removed HttpClient import from app.module.ts as it's not needed.

Hi @jrstrayhorn 👋

BrowserModule already re-exports CommonModule so we don't need to explicitly add it. I just checked the current version of the store walkthrough app and it worked: https://stackblitz.com/edit/angular-9arttf?file=src%2Fapp%2Fapp.module.ts

markostanimirovic avatar Oct 02 '22 21:10 markostanimirovic