fix(core): Update types for TypeScript nullability support (#15472)
This commit is contained in:

committed by
Victor Berchet

parent
331b9f6425
commit
910c0d9ee7
@ -40,7 +40,7 @@ export function init(moduleRef: NgModuleRef<AppModule>) {
|
||||
|
||||
const injector = moduleRef.injector;
|
||||
appRef = injector.get(ApplicationRef);
|
||||
const numberOfChecksEl = document.getElementById('numberOfChecks');
|
||||
const numberOfChecksEl = document.getElementById('numberOfChecks') !;
|
||||
|
||||
tree = appRef.components[0].instance;
|
||||
|
||||
|
@ -13,10 +13,10 @@ export class TreeNode {
|
||||
children: TreeNode[];
|
||||
|
||||
constructor(
|
||||
public value: string, public depth: number, public maxDepth: number, public left: TreeNode,
|
||||
public right: TreeNode) {
|
||||
public value: string, public depth: number, public maxDepth: number,
|
||||
public left: TreeNode|null, public right: TreeNode|null) {
|
||||
this.transitiveChildCount = Math.pow(2, (this.maxDepth - this.depth + 1)) - 1;
|
||||
this.children = this.left ? [this.left, this.right] : [];
|
||||
this.children = this.left ? [this.left, this.right !] : [];
|
||||
}
|
||||
|
||||
// Needed for Polymer as it does not support ternary nor modulo operator
|
||||
|
Reference in New Issue
Block a user