Created
August 25, 2017 17:34
-
-
Save rafaelvicio/d4c38782bdbd10e551adccd31cabfdd7 to your computer and use it in GitHub Desktop.
Verifica logado Angular2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app.component.html | |
| <ul class="nav navbar-nav navbar-right" *ngIf="usuario.verificaLogado"> | |
| <li><a href="../navbar/">Olá</a></li> | |
| </ul> | |
| usuario.component.ts | |
| export class UsuarioComponent implements OnInit { | |
| @Input() _id: string; | |
| @Input() login: string; | |
| @Input() senha: string; | |
| @Input() nome: string; | |
| constructor() { } | |
| ngOnInit() { | |
| } | |
| } | |
| usuario.service.component.ts | |
| verificaLogado(): Boolean { | |
| return true; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment