File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { ActivatedRoute , Router } from '@angular/router' ;
2
2
import { Community , Communities } from '@shared/interfaces' ;
3
3
import { Component , Input } from '@angular/core' ;
4
- import { map } from 'rxjs/operators' ;
4
+ import { map , withLatestFrom } from 'rxjs/operators' ;
5
5
import { CommunityService } from '@shared/services' ;
6
6
7
7
@Component ( {
@@ -11,9 +11,11 @@ import { CommunityService } from '@shared/services';
11
11
} )
12
12
export class MainComponent {
13
13
@Input ( )
14
- /* communities: Communities; */
15
14
communitie$ = this . communityService . communities ;
16
- community$ = this . route . fragment . pipe ( map ( community => this . communitie$ [ community ] ) ) ;
15
+ community$ = this . route . fragment . pipe (
16
+ withLatestFrom ( this . communitie$ ) ,
17
+ map ( ( [ community , communities ] ) => communities [ community ] ) ,
18
+ ) ;
17
19
18
20
constructor (
19
21
private router : Router ,
You can’t perform that action at this time.
0 commit comments