-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs(data): add tour of heroes demo app #3131
docs(data): add tour of heroes demo app #3131
Conversation
Preview docs changes for f5b2e51 at https://previews.ngrx.io/pr3131-f5b2e513/ |
I think we need Tour of Heroes app with |
Oh no did I copy the wrong app. Uh oh haha |
@markostanimirovic updated! my bad! |
Hmm somehow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work Jay! 🥇
Most of the suggestions are related to enabling strict mode 😅
], | ||
declarations: [ModalComponent, ToolbarComponent], | ||
exports: [ToolbarComponent], | ||
entryComponents: [ModalComponent], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
entryComponents: [ModalComponent], |
no longer needed with Ivy :)
@@ -0,0 +1,5 @@ | |||
export class Hero { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export class Hero { | |
export interface Hero { |
@@ -0,0 +1,5 @@ | |||
export class Villain { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export class Villain { | |
export interface Villain { |
@@ -3,7 +3,8 @@ | |||
"compilerOptions": { | |||
"outDir": "../../dist/out-tsc", | |||
"module": "commonjs", | |||
"types": ["jest", "node"] | |||
"types": ["jest", "node"], | |||
"strict": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"strict": false |
😁
parsed.collectionName = | ||
this.active && isDefaultRoot | ||
? mapCollectionName(parsed.collectionName) | ||
: undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: undefined; | |
: ''; |
@Output() add = new EventEmitter<Villain>(); | ||
@Output() update = new EventEmitter<Villain>(); | ||
|
||
@ViewChild('name', { static: true }) nameElement: ElementRef; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ViewChild('name', { static: true }) nameElement: ElementRef; | |
@ViewChild('name', { static: true }) nameElement!: ElementRef; |
@Input() villains: Villain[]; | ||
@Input() selectedVillain: Villain; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Input() villains: Villain[]; | |
@Input() selectedVillain: Villain; | |
@Input() villains: Villain[] = []; | |
@Input() selectedVillain: Villain | Record<string, never> | null = null; |
@@ -0,0 +1,54 @@ | |||
import { Component, OnInit } from '@angular/core'; | |||
import { Observable } from 'rxjs'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Observable } from 'rxjs'; |
loading$: Observable<boolean>; | ||
selected: Villain; | ||
villains$: Observable<Villain[]>; | ||
|
||
constructor(private villainService: VillainService) { | ||
this.villains$ = villainService.entities$; | ||
this.loading$ = villainService.loading$; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loading$: Observable<boolean>; | |
selected: Villain; | |
villains$: Observable<Villain[]>; | |
constructor(private villainService: VillainService) { | |
this.villains$ = villainService.entities$; | |
this.loading$ = villainService.loading$; | |
} | |
villains$ = this.villainService.entities$; | |
loading$ = this.villainService.loading$; | |
selected: Villain | Record<string, never> | null = null; | |
constructor(private villainService: VillainService) {} |
} | ||
|
||
enableAddMode() { | ||
this.selected = <any>{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.selected = <any>{}; | |
this.selected = {}; |
Haha thanks Marko! I'll work on this tonight. I think the other example app has strict disabled so figured it was fine for here as well. I did do a literally copy paste so there's probably a lot of easy cleanup to be done. |
@yharaskrik will you fix the merge conflicts here also? Thanks! |
Yup! I still gotta work on Markos suggestions too it seems, work has a strangle hold on me right now! Ill get the changes and conflicts done soon hopefully. |
Going to close this one for now. Feel free to reopen or open a new one when ready |
@yharaskrik Would you like to re-open this PR with applied suggestions? 👀 If you don't have time, I can take care of it. |
I can take a look! Although it does not seem that I can reopen it! Can you reopen for me please and thanks! |
I'm closing this again. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #3004
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Did do too much rewriting of the app, mostly just a port from the original repo.