Forked from rafaelvicio/gist:d4c38782bdbd10e551adccd31cabfdd7
Created
August 26, 2017 00:40
-
-
Save beingsane/bc5d5c7f092f39d0aa8e4db11aba19f6 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