Skip to content

Commit

Permalink
feat(examples): Disable authenticated link when not authenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Kairis committed Aug 25, 2018
1 parent 14e0507 commit cafa041
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/app/examples/examples/examples.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
*ngFor="let e of examples"
[routerLink]="e.link"
routerLinkActive #rla="routerLinkActive"
[active]="rla.isActive">
[active]="rla.isActive"
[disabled]="e.link == 'authenticated' && !auth.isAuthenticated">
{{e.label | translate}}
</a>
</nav>
Expand Down
5 changes: 3 additions & 2 deletions src/app/examples/examples/examples.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ActivationEnd, Router } from '@angular/router';
import { filter, takeUntil, map } from 'rxjs/operators';
import { Subject } from 'rxjs';

import { routeAnimations, TitleService } from '@app/core';
import { routeAnimations, TitleService, AuthGuardService } from '@app/core';
import { selectSettings, SettingsState } from '@app/settings';

import { State } from '../examples.state';
Expand All @@ -30,7 +30,8 @@ export class ExamplesComponent implements OnInit, OnDestroy {
private store: Store<State>,
private router: Router,
private titleService: TitleService,
private translate: TranslateService
private translate: TranslateService,
private auth: AuthGuardService
) {}

ngOnInit(): void {
Expand Down

0 comments on commit cafa041

Please sign in to comment.