File
Metadata
selector |
ab-login-button |
template |
<div>
<button *ngIf="!authenticated" class="btn btn-primary" >{{ 'LOGIN' | translate }}</button>
</div>
<div>
<button *ngIf="authenticated"class="btn btn-primary" >{{ 'LOGOUT' | translate }}</button>
</div>
|
import {Component, Input} from '@angular/core';
@Component({
selector: 'ab-login-button',
template: `
<div>
<button *ngIf="!authenticated" class="btn btn-primary" >{{ 'LOGIN' | translate }}</button>
</div>
<div>
<button *ngIf="authenticated"class="btn btn-primary" >{{ 'LOGOUT' | translate }}</button>
</div>
`
})
export class LoginButtonComponent {
@Input() autoLogin: boolean; // todo
@Input() authenticated: boolean;
constructor() { }
}
Legend
Html element with directive