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-test-component></app-test-component> |
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
<div [ngClass]="{ 'without-number': formEntry.phone === null, 'named-john': formEntry.name === 'John Doe' }"> | |
<p appTestDirective *ngIf="formEntry.name">The name is {{formEntry.name}} </p> | |
<p appTestDirective *ngIf="formEntry.address">The address is {{formEntry.address}} </p> | |
<ng-template [ngIf] = "formEntry.phone"> | |
<p>The phone number is</p> | |
<p> {{formEntry.phone}} </p> | |
</ng-template> |
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
import { | |
Directive, | |
Input, | |
ElementRef, | |
HostListener | |
} from '@angular/core'; | |
@Directive({ | |
selector: '[appTestDirective]' | |
}) |
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
import { | |
Directive, | |
Input, | |
ElementRef, | |
HostListener | |
} from '@angular/core'; | |
@Directive({ | |
selector: '[appTestDirective]' | |
}) |
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
import { | |
Directive, | |
Input, | |
ElementRef, | |
HostListener | |
} from '@angular/core'; | |
@Directive({ | |
selector: '[appTestDirective]' | |
}) |
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
import { | |
Directive, | |
Input, | |
ElementRef, | |
HostListener | |
} from '@angular/core'; | |
@Directive({ | |
selector: '[appTestDirective]' | |
}) |
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
.without-number { | |
color: red; | |
} | |
.named-john { | |
color:blue; | |
} |
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
<div [ngClass]="{ 'without-number': formEntry.phone === null, 'named-john': formEntry.name === 'John Doe' }"> | |
<p *ngIf="formEntry.name">The name is {{formEntry.name}} </p> | |
<p *ngIf="formEntry.address">The address is {{formEntry.address}} </p> | |
<ng-template [ngIf] = "formEntry.phone"> | |
<p>The phone number is</p> | |
<p> {{formEntry.phone}} </p> | |
</ng-template> | |
</div> |
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
.without-number { | |
color: red; | |
} |
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
<div [ngClass]="{ 'without-number': formEntry.phone === null }"> | |
<p *ngIf="formEntry.name">The name is {{formEntry.name}} </p> | |
<p *ngIf="formEntry.address">The address is {{formEntry.address}} </p> | |
<ng-template [ngIf] = "formEntry.phone"> | |
<p>The phone number is</p> | |
<p> {{formEntry.phone}} </p> | |
</ng-template> | |
</div> |