Conversation
tonivj5
left a comment
There was a problem hiding this comment.
Good work! :-)
We should change service to avoid perform more requests than needed
| src="assets/images/angular-communities-logo_md.png" | ||
| /> | ||
| <span>ANGULAR COMMUNITIES</span> | ||
| <a routerLink="">ANGULAR COMMUNITIES</a> |
src/app/pages/main/main.component.ts
Outdated
| communities: Communities; | ||
| /* communities: Communities; */ | ||
| communitie$ = this.communityService.communities; | ||
| community$ = this.route.fragment.pipe(map(community => this.communitie$[community])); |
There was a problem hiding this comment.
This isn't going to work communitie$ is an observable now. I think it should work
| community$ = this.route.fragment.pipe(map(community => this.communitie$[community])); | |
| community$ = this.route.fragment.pipe(withLatestFrom(this.communitie$), map(([community, communities]) => communities[community])); |
src/app/pages/main/main.component.ts
Outdated
| @Input() | ||
| communities: Communities; | ||
| /* communities: Communities; */ | ||
| communitie$ = this.communityService.communities; |
There was a problem hiding this comment.
This observable is going to perform two requests and more if we move to the new faq page and come back. We should avoid it using shareReplay(1), but it can't be placed here. We should change service, and move communities getter to simple property (communitie$?). Something like
communitie$ = this.httpClient
.get<Communities>(this.JSON_COMMUNITIES)
.pipe(map(communities => this.normalizeCommunities(communities)), shareReplay(1));
src/app/pages/faq/faq.module.ts
Outdated
|
|
||
| @NgModule({ | ||
| declarations: [...COMPONENTS], | ||
| imports: [CommonModule, SharedModule, FlexLayoutModule, ReactiveFormsModule, MatInputModule], |
There was a problem hiding this comment.
All the modules are imported via shared, can be removed 👍
| imports: [CommonModule, SharedModule, FlexLayoutModule, ReactiveFormsModule, MatInputModule], | |
| imports: [SharedModule], |
There was a problem hiding this comment.
Yeah, those modules shouldn't even be imported in faqModule anyway. My mistake, for copy-pasting xD
src/app/pages/faq/faq.module.ts
Outdated
| const COMPONENTS = [FaqComponent]; | ||
|
|
||
| @NgModule({ | ||
| declarations: [...COMPONENTS], |
There was a problem hiding this comment.
By the way, it isn't needed spread it, like in SharedModule
| declarations: [...COMPONENTS], | |
| declarations: [COMPONENTS], |
There was a problem hiding this comment.
Once again, my mistake for copy-pasting 😅
| font-size: 16px; | ||
| } | ||
|
|
||
| .question { |
There was a problem hiding this comment.
We should make the design responsive
src/app/app-routing.module.ts
Outdated
|
|
||
| const routes: Routes = [ | ||
| { path: '', component: MainComponent }, | ||
| { path: 'faq', component: FaqComponent }, |
There was a problem hiding this comment.
The FAQ module can be built in a lazy way
|
SonarCloud Quality Gate failed. |
Regarding #59