Skip to content

Instantly share code, notes, and snippets.

@rafaelvicio
Created August 25, 2017 17:34
Show Gist options
  • Select an option

  • Save rafaelvicio/d4c38782bdbd10e551adccd31cabfdd7 to your computer and use it in GitHub Desktop.

Select an option

Save rafaelvicio/d4c38782bdbd10e551adccd31cabfdd7 to your computer and use it in GitHub Desktop.
Verifica logado Angular2
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