build: upgrade to TypeScript 2.8 (#23782)

PR Close #23782
This commit is contained in:
Lucas Sloan
2018-05-08 13:37:54 -07:00
committed by Alex Rickabaugh
parent e5e5c24d48
commit 5cf82f8f3f
15 changed files with 127 additions and 33 deletions

View File

@ -11,7 +11,7 @@ import {ApplicationRef, ChangeDetectorRef, ComponentFactory, ComponentRef, Event
import * as angular from './angular1';
import {PropertyBinding} from './component_info';
import {$SCOPE} from './constants';
import {getAttributesAsArray, getComponentName, hookupNgModel, strictEquals} from './util';
import {getComponentName, hookupNgModel, strictEquals} from './util';
const INITIAL_VALUE = {
__UNINITIALIZED__: true

View File

@ -32,19 +32,6 @@ export function directiveNormalize(name: string): string {
.replace(DIRECTIVE_SPECIAL_CHARS_REGEXP, (_, letter) => letter.toUpperCase());
}
export function getAttributesAsArray(node: Node): [string, string][] {
const attributes = node.attributes;
let asArray: [string, string][] = undefined !;
if (attributes) {
let attrLen = attributes.length;
asArray = new Array(attrLen);
for (let i = 0; i < attrLen; i++) {
asArray[i] = [attributes[i].nodeName, attributes[i].nodeValue !];
}
}
return asArray || [];
}
export function getComponentName(component: Type<any>): string {
// Return the name of the component or the first line of its stringified version.
return (component as any).overriddenName || component.name || component.toString().split('\n')[0];