fix(core): Update types for TypeScript nullability support (#15472)

This commit is contained in:
Miško Hevery
2017-03-29 09:34:45 -07:00
committed by Victor Berchet
parent 331b9f6425
commit 910c0d9ee7
84 changed files with 1287 additions and 1260 deletions

View File

@ -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;

View File

@ -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