fix: Update types for TypeScript nullability support in examples
This commit is contained in:
@ -57,13 +57,13 @@ class NgIfElse {
|
||||
`
|
||||
})
|
||||
class NgIfThenElse implements OnInit {
|
||||
thenBlock: TemplateRef<any> = null;
|
||||
thenBlock: TemplateRef<any>|null = null;
|
||||
show: boolean = true;
|
||||
|
||||
@ViewChild('primaryBlock')
|
||||
primaryBlock: TemplateRef<any> = null;
|
||||
primaryBlock: TemplateRef<any>|null = null;
|
||||
@ViewChild('secondaryBlock')
|
||||
secondaryBlock: TemplateRef<any> = null;
|
||||
secondaryBlock: TemplateRef<any>|null = null;
|
||||
|
||||
switchPrimary() {
|
||||
this.thenBlock = this.thenBlock === this.primaryBlock ? this.secondaryBlock : this.primaryBlock;
|
||||
|
@ -20,10 +20,10 @@ import {Subscriber} from 'rxjs/Subscriber';
|
||||
</div>`
|
||||
})
|
||||
export class AsyncPromisePipeComponent {
|
||||
greeting: Promise<string> = null;
|
||||
greeting: Promise<string>|null = null;
|
||||
arrived: boolean = false;
|
||||
|
||||
private resolve: Function = null;
|
||||
private resolve: Function|null = null;
|
||||
|
||||
constructor() { this.reset(); }
|
||||
|
||||
@ -36,7 +36,7 @@ export class AsyncPromisePipeComponent {
|
||||
if (this.arrived) {
|
||||
this.reset();
|
||||
} else {
|
||||
this.resolve('hi there!');
|
||||
this.resolve !('hi there!');
|
||||
this.arrived = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user