chore: clang-reformat

This commit is contained in:
Misko Hevery 2016-05-01 22:50:37 -07:00
parent bb8976608d
commit 3e17c99f4e
108 changed files with 1120 additions and 1129 deletions

View File

@ -1569,7 +1569,6 @@ var firstTask = true;
gulp.on('task_start', (e) => {
if (firstTask) {
firstTask = false;

View File

@ -3,4 +3,3 @@ export * from './src/directives';
export * from './src/forms';
export * from './src/common_directives';
export * from './src/location';

View File

@ -7,7 +7,8 @@
* to read information
* from the form DOM elements.
*
* Forms providers are not included in default providers; you must import these providers explicitly.
* Forms providers are not included in default providers; you must import these providers
* explicitly.
*/
export {AbstractControl, Control, ControlGroup, ControlArray} from './forms/model';

View File

@ -12,10 +12,7 @@ import {
} from '@angular/core';
import {isPresent} from '../../../src/facade/lang';
import {ListWrapper} from '../../../src/facade/collection';
import {
NG_VALUE_ACCESSOR,
ControlValueAccessor
} from './control_value_accessor';
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
import {NgControl} from './ng_control';
export const RADIO_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {

View File

@ -1,10 +1,4 @@
import {
Pipe,
Injectable,
ChangeDetectorRef,
OnDestroy,
WrappedValue
} from '@angular/core';
import {Pipe, Injectable, ChangeDetectorRef, OnDestroy, WrappedValue} from '@angular/core';
import {isBlank, isPresent, isPromise} from '../../src/facade/lang';
import {ObservableWrapper, Observable, EventEmitter} from '../../src/facade/async';

View File

@ -1,10 +1,5 @@
import {Injectable, PipeTransform, Pipe} from '@angular/core';
import {
isStringMap,
StringWrapper,
isPresent,
RegExpWrapper
} from '../../src/facade/lang';
import {isStringMap, StringWrapper, isPresent, RegExpWrapper} from '../../src/facade/lang';
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
var interpolationExp: RegExp = RegExpWrapper.create('#');

View File

@ -10,7 +10,7 @@ import {
it,
xit,
} from '@angular/core/testing/testing_internal';
import { ComponentFixture, TestComponentBuilder } from '@angular/compiler/testing';
import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {ListWrapper, StringMapWrapper, SetWrapper} from '../../src/facade/collection';
import {Component, provide} from '@angular/core';

View File

@ -28,7 +28,8 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
async.done();
@ -44,7 +45,8 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello2');
async.done();
@ -60,19 +62,22 @@ export function main() {
.then((fixture) => {
fixture.debugElement.componentInstance.booleanCondition = false;
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
fixture.debugElement.componentInstance.booleanCondition = true;
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
fixture.debugElement.componentInstance.booleanCondition = false;
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
@ -90,31 +95,36 @@ export function main() {
.then((fixture) => {
fixture.debugElement.componentInstance.booleanCondition = false;
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
fixture.debugElement.componentInstance.booleanCondition = true;
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
fixture.debugElement.componentInstance.nestedBooleanCondition = false;
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
fixture.debugElement.componentInstance.nestedBooleanCondition = true;
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
fixture.debugElement.componentInstance.booleanCondition = false;
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
@ -135,21 +145,24 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(3);
expect(getDOM().getText(fixture.debugElement.nativeElement))
.toEqual('helloNumberhelloStringhelloFunction');
fixture.debugElement.componentInstance.numberCondition = 0;
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('helloString');
fixture.debugElement.componentInstance.numberCondition = 1;
fixture.debugElement.componentInstance.stringCondition = "bar";
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('helloNumber');
async.done();
@ -166,13 +179,17 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM()
.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me')
.length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
fixture.debugElement.componentInstance.numberCondition = 2;
fixture.detectChanges();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM()
.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me')
.length)
.toEqual(1);
expect(fixture.debugElement.nativeElement).toHaveText('hello');
@ -188,14 +205,14 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
getDOM().addClass(getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'),
"foo");
getDOM().addClass(
getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'), "foo");
fixture.debugElement.componentInstance.numberCondition = 2;
fixture.detectChanges();
expect(
getDOM().hasClass(getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'),
"foo"))
expect(getDOM().hasClass(
getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'),
"foo"))
.toBe(true);
async.done();
@ -212,7 +229,9 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
expect(() => fixture.detectChanges()).toThrowError();
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
expect(getDOM()
.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me')
.length)
.toEqual(0);
expect(fixture.debugElement.nativeElement).toHaveText('');
async.done();

View File

@ -31,7 +31,8 @@ export function main() {
.createAsync(TestComponent)
.then((fixture) => {
fixture.detectChanges();
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('40px');
async.done();
@ -49,13 +50,15 @@ export function main() {
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
fixture.detectChanges();
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('40px');
expr = fixture.debugElement.componentInstance.expr;
expr['max-width'] = '30%';
fixture.detectChanges();
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('30%');
async.done();
@ -71,12 +74,14 @@ export function main() {
.then((fixture) => {
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
fixture.detectChanges();
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('40px');
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
fixture.detectChanges();
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('');
async.done();
@ -92,16 +97,20 @@ export function main() {
.then((fixture) => {
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
fixture.detectChanges();
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('40px');
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
.toEqual('12px');
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
fixture.detectChanges();
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('');
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
.toEqual('12px');
async.done();
@ -117,17 +126,21 @@ export function main() {
.then((fixture) => {
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
fixture.detectChanges();
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('40px');
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
.toEqual('12px');
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
.toEqual('12px');
fixture.detectChanges();
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
expect(
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
.toEqual('');
async.done();

File diff suppressed because it is too large Load Diff

View File

@ -9,12 +9,7 @@ import {
afterEach,
inject,
} from '@angular/core/testing/testing_internal';
import {
fakeAsync,
flushMicrotasks,
Log,
tick
} from '@angular/core/testing';
import {fakeAsync, flushMicrotasks, Log, tick} from '@angular/core/testing';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {ControlGroup, Control, ControlArray, Validators} from '@angular/common';
import {IS_DART, isPresent} from '../../src/facade/lang';

View File

@ -8,12 +8,7 @@ import {
beforeEach,
afterEach
} from '@angular/core/testing/testing_internal';
import {
fakeAsync,
flushMicrotasks,
Log,
tick
} from '@angular/core/testing';
import {fakeAsync, flushMicrotasks, Log, tick} from '@angular/core/testing';
import {ControlGroup, Control, Validators, AbstractControl, ControlArray} from '@angular/common';
import {PromiseWrapper} from '../../src/facade/promise';
import {EventEmitter, ObservableWrapper, TimerWrapper} from '../../src/facade/async';

View File

@ -10,6 +10,4 @@ export class SpyChangeDetectorRef extends SpyObject {
export class SpyNgControl extends SpyObject {}
export class SpyValueAccessor extends SpyObject {
writeValue: any;
}
export class SpyValueAccessor extends SpyObject { writeValue: any; }

View File

@ -1,16 +1,19 @@
import {__core_private__ as r, __core_private_types__ as t} from '@angular/core';
export var isDefaultChangeDetectionStrategy: typeof t.isDefaultChangeDetectionStrategy = r.isDefaultChangeDetectionStrategy;
export var isDefaultChangeDetectionStrategy: typeof t.isDefaultChangeDetectionStrategy =
r.isDefaultChangeDetectionStrategy;
export type ChangeDetectorState = t.ChangeDetectorState;
export var ChangeDetectorState: typeof t.ChangeDetectorState = r.ChangeDetectorState;
export var CHANGE_DETECTION_STRATEGY_VALUES: typeof t.CHANGE_DETECTION_STRATEGY_VALUES = r.CHANGE_DETECTION_STRATEGY_VALUES;
export var CHANGE_DETECTION_STRATEGY_VALUES: typeof t.CHANGE_DETECTION_STRATEGY_VALUES =
r.CHANGE_DETECTION_STRATEGY_VALUES;
export var constructDependencies: typeof t.constructDependencies = r.constructDependencies;
export type LifecycleHooks = t.LifecycleHooks;
export var LifecycleHooks: typeof t.LifecycleHooks = r.LifecycleHooks;
export var LIFECYCLE_HOOKS_VALUES: typeof t.LIFECYCLE_HOOKS_VALUES = r.LIFECYCLE_HOOKS_VALUES;
export type ReflectorReader = t.ReflectorReader;
export var ReflectorReader: typeof t.ReflectorReader = r.ReflectorReader;
export var ReflectorComponentResolver: typeof t.ReflectorComponentResolver = r.ReflectorComponentResolver;
export var ReflectorComponentResolver: typeof t.ReflectorComponentResolver =
r.ReflectorComponentResolver;
export type AppElement = t.AppElement;
export var AppElement: typeof t.AppElement = r.AppElement;
export var AppView: typeof t.AppView = r.AppView;
@ -20,10 +23,12 @@ export type ViewType = t.ViewType;
export var ViewType: typeof t.ViewType = r.ViewType;
export var MAX_INTERPOLATION_VALUES: typeof t.MAX_INTERPOLATION_VALUES = r.MAX_INTERPOLATION_VALUES;
export var checkBinding: typeof t.checkBinding = r.checkBinding;
export var flattenNestedViewRenderNodes: typeof t.flattenNestedViewRenderNodes = r.flattenNestedViewRenderNodes;
export var flattenNestedViewRenderNodes: typeof t.flattenNestedViewRenderNodes =
r.flattenNestedViewRenderNodes;
export var interpolate: typeof t.interpolate = r.interpolate;
export var ViewUtils: typeof t.ViewUtils = r.ViewUtils;
export var VIEW_ENCAPSULATION_VALUES: typeof t.VIEW_ENCAPSULATION_VALUES = r.VIEW_ENCAPSULATION_VALUES;
export var VIEW_ENCAPSULATION_VALUES: typeof t.VIEW_ENCAPSULATION_VALUES =
r.VIEW_ENCAPSULATION_VALUES;
export var DebugContext: typeof t.DebugContext = r.DebugContext;
export var StaticNodeDebugInfo: typeof t.StaticNodeDebugInfo = r.StaticNodeDebugInfo;
export var devModeEqual: typeof t.devModeEqual = r.devModeEqual;
@ -49,4 +54,3 @@ export var pureProxy10: typeof t.pureProxy10 = r.pureProxy10;
export var castByValue: typeof t.castByValue = r.castByValue;
export type Console = t.Console;
export var Console: typeof t.Console = r.Console;

View File

@ -316,7 +316,9 @@ export class CompileTokenMetadata implements CompileMetadataWithIdentifier {
(isPresent(ak) && ak == token2.assetCacheKey);
}
get name(): string { return isPresent(this.value) ? sanitizeIdentifier(this.value) : this.identifier.name; }
get name(): string {
return isPresent(this.value) ? sanitizeIdentifier(this.value) : this.identifier.name;
}
}
export class CompileTokenMap<VALUE> {

View File

@ -12,7 +12,7 @@ import {
ContentChildMetadata,
ViewChildMetadata,
reflector
} from '@angular/core';
} from '@angular/core';
import {ReflectorReader} from '../core_private';
import {Type, isPresent, stringify} from '../src/facade/lang';

View File

@ -1,10 +1,4 @@
import {
StringWrapper,
NumberWrapper,
isPresent,
isBlank,
serializeEnum
} from '../src/facade/lang';
import {StringWrapper, NumberWrapper, isPresent, isBlank, serializeEnum} from '../src/facade/lang';
import {ListWrapper} from '../src/facade/collection';
import {ParseLocation, ParseError, ParseSourceFile, ParseSourceSpan} from './parse_util';
import {getHtmlTagDefinition, HtmlTagContentType, NAMED_ENTITIES} from './html_tags';

View File

@ -84,20 +84,14 @@ var impEMPTY_ARRAY = EMPTY_ARRAY;
var impEMPTY_MAP = EMPTY_MAP;
export class Identifiers {
static ViewUtils = new CompileIdentifierMetadata({
name: 'ViewUtils',
moduleUrl: assetUrl('core', 'linker/view_utils'),
runtime: impViewUtils
});
static ViewUtils = new CompileIdentifierMetadata(
{name: 'ViewUtils', moduleUrl: assetUrl('core', 'linker/view_utils'), runtime: impViewUtils});
static AppView = new CompileIdentifierMetadata(
{name: 'AppView', moduleUrl: APP_VIEW_MODULE_URL, runtime: impAppView});
static DebugAppView = new CompileIdentifierMetadata(
{name: 'DebugAppView', moduleUrl: APP_VIEW_MODULE_URL, runtime: impDebugAppView});
static AppElement = new CompileIdentifierMetadata({
name: 'AppElement',
moduleUrl: assetUrl('core', 'linker/element'),
runtime: impAppElement
});
static AppElement = new CompileIdentifierMetadata(
{name: 'AppElement', moduleUrl: assetUrl('core', 'linker/element'), runtime: impAppElement});
static ElementRef = new CompileIdentifierMetadata({
name: 'ElementRef',
moduleUrl: assetUrl('core', 'linker/element_ref'),
@ -118,11 +112,8 @@ export class Identifiers {
moduleUrl: assetUrl('core', 'render/api'),
runtime: impRenderComponentType
});
static QueryList = new CompileIdentifierMetadata({
name: 'QueryList',
moduleUrl: assetUrl('core', 'linker/query_list'),
runtime: impQueryList
});
static QueryList = new CompileIdentifierMetadata(
{name: 'QueryList', moduleUrl: assetUrl('core', 'linker/query_list'), runtime: impQueryList});
static TemplateRef = new CompileIdentifierMetadata({
name: 'TemplateRef',
moduleUrl: assetUrl('core', 'linker/template_ref'),
@ -135,21 +126,15 @@ export class Identifiers {
});
static ValueUnwrapper = new CompileIdentifierMetadata(
{name: 'ValueUnwrapper', moduleUrl: CD_MODULE_URL, runtime: impValueUnwrapper});
static Injector = new CompileIdentifierMetadata({
name: 'Injector',
moduleUrl: assetUrl('core', 'di/injector'),
runtime: impInjector
});
static Injector = new CompileIdentifierMetadata(
{name: 'Injector', moduleUrl: assetUrl('core', 'di/injector'), runtime: impInjector});
static ViewEncapsulation = new CompileIdentifierMetadata({
name: 'ViewEncapsulation',
moduleUrl: assetUrl('core', 'metadata/view'),
runtime: impViewEncapsulation
});
static ViewType = new CompileIdentifierMetadata({
name: 'ViewType',
moduleUrl: assetUrl('core', 'linker/view_type'),
runtime: impViewType
});
static ViewType = new CompileIdentifierMetadata(
{name: 'ViewType', moduleUrl: assetUrl('core', 'linker/view_type'), runtime: impViewType});
static ChangeDetectionStrategy = new CompileIdentifierMetadata({
name: 'ChangeDetectionStrategy',
moduleUrl: CD_MODULE_URL,
@ -165,11 +150,8 @@ export class Identifiers {
moduleUrl: assetUrl('core', 'linker/debug_context'),
runtime: impDebugContext
});
static Renderer = new CompileIdentifierMetadata({
name: 'Renderer',
moduleUrl: assetUrl('core', 'render/api'),
runtime: impRenderer
});
static Renderer = new CompileIdentifierMetadata(
{name: 'Renderer', moduleUrl: assetUrl('core', 'render/api'), runtime: impRenderer});
static SimpleChange = new CompileIdentifierMetadata(
{name: 'SimpleChange', moduleUrl: CD_MODULE_URL, runtime: impSimpleChange});
static uninitialized = new CompileIdentifierMetadata(

View File

@ -1,11 +1,6 @@
import {Injectable, Provider, provide} from '@angular/core';
import {
StringWrapper,
RegExpWrapper,
isBlank,
isPresent
} from '../src/facade/lang';
import {StringWrapper, RegExpWrapper, isBlank, isPresent} from '../src/facade/lang';
import {
HtmlAstVisitor,

View File

@ -7,9 +7,12 @@ import {
HostMetadata,
SkipSelfMetadata,
Provider,
PLATFORM_DIRECTIVES, PLATFORM_PIPES,
PLATFORM_DIRECTIVES,
PLATFORM_PIPES,
reflector,
Injectable, Inject, Optional,
Injectable,
Inject,
Optional,
ViewMetadata,
NoAnnotationError,
QueryMetadata,
@ -17,10 +20,7 @@ import {
InjectMetadata,
ViewQueryMetadata
} from '@angular/core';
import {
constructDependencies,
LIFECYCLE_HOOKS_VALUES, ReflectorReader
} from '../core_private';
import {constructDependencies, LIFECYCLE_HOOKS_VALUES, ReflectorReader} from '../core_private';
import {
Type,
isBlank,
@ -413,7 +413,7 @@ function calcTemplateBaseUrl(reflector: ReflectorReader, type: any,
var moduleId = cmpMetadata.moduleId;
var scheme = getUrlScheme(moduleId);
return isPresent(scheme) && scheme.length > 0 ? moduleId :
`package:${moduleId}${MODULE_SUFFIX}`;
`package:${moduleId}${MODULE_SUFFIX}`;
}
return reflector.importUri(type);

View File

@ -17,7 +17,8 @@ import {OutputEmitter} from './output/abstract_emitter';
import * as o from './output/output_ast';
import {
MODULE_SUFFIX, assetUrl,
MODULE_SUFFIX,
assetUrl,
} from './util';
var _COMPONENT_FACTORY_IDENTIFIER = new CompileIdentifierMetadata({

View File

@ -1,9 +1,4 @@
import {
isPresent,
isBlank,
isString,
StringWrapper
} from '../../src/facade/lang';
import {isPresent, isBlank, isString, StringWrapper} from '../../src/facade/lang';
import {BaseException} from '../../src/facade/exceptions';
import * as o from './output_ast';

View File

@ -1,8 +1,4 @@
import {
isPresent,
isBlank,
isArray
} from '../../src/facade/lang';
import {isPresent, isBlank, isArray} from '../../src/facade/lang';
import {BaseException} from '../../src/facade/exceptions';
import {CompileIdentifierMetadata} from '../compile_metadata';
import * as o from './output_ast';

View File

@ -1,9 +1,5 @@
import {reflector} from '@angular/core';
import {
isPresent,
IS_DART,
FunctionWrapper
} from '../../src/facade/lang';
import {isPresent, IS_DART, FunctionWrapper} from '../../src/facade/lang';
import {ObservableWrapper} from '../../src/facade/async';
import {BaseException, unimplemented} from '../../src/facade/exceptions';
import {ListWrapper} from '../../src/facade/collection';

View File

@ -1,9 +1,5 @@
import * as o from './output_ast';
import {
isPresent,
isBlank,
isArray
} from '../../src/facade/lang';
import {isPresent, isBlank, isArray} from '../../src/facade/lang';
import {BaseException} from '../../src/facade/exceptions';
import {CompileIdentifierMetadata} from '../compile_metadata';
import {

View File

@ -1,8 +1,6 @@
import {resolveForwardRef, Injectable, PipeMetadata, reflector} from '@angular/core';
import {
ReflectorReader
} from '../core_private';
import {ReflectorReader} from '../core_private';
import {Type, isPresent, stringify} from '../src/facade/lang';
import {BaseException} from '../src/facade/exceptions';

View File

@ -5,7 +5,8 @@ import {
AttrAst,
DirectiveAst,
ProviderAst,
ProviderAstType, ReferenceAst
ProviderAstType,
ReferenceAst
} from './template_ast';
import {
CompileTypeMetadata,

View File

@ -50,153 +50,153 @@ const OBJECT = 'object';
* NOTE: This schema is auto extracted from `schema_extractor.ts` located in the test folder.
*/
const SCHEMA: string[] =
/*@ts2dart_const*/ ([
'*|%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop',
'^*|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*autocomplete,*autocompleteerror,*beforecopy,*beforecut,*beforepaste,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*message,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*paste,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*search,*seeked,*seeking,*select,*selectstart,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate',
'media|!autoplay,!controls,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,#playbackRate,preload,src,#volume',
'@svg:^*|*abort,*autocomplete,*autocompleteerror,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex',
'@svg:graphics^@svg:|',
'@svg:animation^@svg:|*begin,*end,*repeat',
'@svg:geometry^@svg:|',
'@svg:componentTransferFunction^@svg:|',
'@svg:gradient^@svg:|',
'@svg:textContent^@svg:graphics|',
'@svg:textPositioning^@svg:textContent|',
'a|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,rel,rev,search,shape,target,text,type,username',
'area|alt,coords,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,search,shape,target,username',
'audio^media|',
'br|clear',
'base|href,target',
'body|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink',
'button|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',
'canvas|#height,#width',
'content|select',
'dl|!compact',
'datalist|',
'details|!open',
'dialog|!open,returnValue',
'dir|!compact',
'div|align',
'embed|align,height,name,src,type,width',
'fieldset|!disabled,name',
'font|color,face,size',
'form|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',
'frame|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src',
'frameset|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows',
'hr|align,color,!noShade,size,width',
'head|',
'h1,h2,h3,h4,h5,h6|align',
'html|version',
'iframe|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,%sandbox,scrolling,src,srcdoc,width',
'img|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,sizes,src,srcset,useMap,#vspace,#width',
'input|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width',
'keygen|!autofocus,challenge,!disabled,keytype,name',
'li|type,#value',
'label|htmlFor',
'legend|align',
'link|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type',
'map|name',
'marquee|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',
'menu|!compact',
'meta|content,httpEquiv,name,scheme',
'meter|#high,#low,#max,#min,#optimum,#value',
'ins,del|cite,dateTime',
'ol|!compact,!reversed,#start,type',
'object|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',
'optgroup|!disabled,label',
'option|!defaultSelected,!disabled,label,!selected,text,value',
'output|defaultValue,%htmlFor,name,value',
'p|align',
'param|name,type,value,valueType',
'picture|',
'pre|#width',
'progress|#max,#value',
'q,blockquote,cite|',
'script|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',
'select|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',
'shadow|',
'source|media,sizes,src,srcset,type',
'span|',
'style|!disabled,media,type',
'caption|align',
'th,td|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',
'col,colgroup|align,ch,chOff,#span,vAlign,width',
'table|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',
'tr|align,bgColor,ch,chOff,vAlign',
'tfoot,thead,tbody|align,ch,chOff,vAlign',
'template|',
'textarea|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',
'title|text',
'track|!default,kind,label,src,srclang',
'ul|!compact,type',
'unknown|',
'video^media|#height,poster,#width',
'@svg:a^@svg:graphics|',
'@svg:animate^@svg:animation|',
'@svg:animateMotion^@svg:animation|',
'@svg:animateTransform^@svg:animation|',
'@svg:circle^@svg:geometry|',
'@svg:clipPath^@svg:graphics|',
'@svg:cursor^@svg:|',
'@svg:defs^@svg:graphics|',
'@svg:desc^@svg:|',
'@svg:discard^@svg:|',
'@svg:ellipse^@svg:geometry|',
'@svg:feBlend^@svg:|',
'@svg:feColorMatrix^@svg:|',
'@svg:feComponentTransfer^@svg:|',
'@svg:feComposite^@svg:|',
'@svg:feConvolveMatrix^@svg:|',
'@svg:feDiffuseLighting^@svg:|',
'@svg:feDisplacementMap^@svg:|',
'@svg:feDistantLight^@svg:|',
'@svg:feDropShadow^@svg:|',
'@svg:feFlood^@svg:|',
'@svg:feFuncA^@svg:componentTransferFunction|',
'@svg:feFuncB^@svg:componentTransferFunction|',
'@svg:feFuncG^@svg:componentTransferFunction|',
'@svg:feFuncR^@svg:componentTransferFunction|',
'@svg:feGaussianBlur^@svg:|',
'@svg:feImage^@svg:|',
'@svg:feMerge^@svg:|',
'@svg:feMergeNode^@svg:|',
'@svg:feMorphology^@svg:|',
'@svg:feOffset^@svg:|',
'@svg:fePointLight^@svg:|',
'@svg:feSpecularLighting^@svg:|',
'@svg:feSpotLight^@svg:|',
'@svg:feTile^@svg:|',
'@svg:feTurbulence^@svg:|',
'@svg:filter^@svg:|',
'@svg:foreignObject^@svg:graphics|',
'@svg:g^@svg:graphics|',
'@svg:image^@svg:graphics|',
'@svg:line^@svg:geometry|',
'@svg:linearGradient^@svg:gradient|',
'@svg:mpath^@svg:|',
'@svg:marker^@svg:|',
'@svg:mask^@svg:|',
'@svg:metadata^@svg:|',
'@svg:path^@svg:geometry|',
'@svg:pattern^@svg:|',
'@svg:polygon^@svg:geometry|',
'@svg:polyline^@svg:geometry|',
'@svg:radialGradient^@svg:gradient|',
'@svg:rect^@svg:geometry|',
'@svg:svg^@svg:graphics|#currentScale,#zoomAndPan',
'@svg:script^@svg:|type',
'@svg:set^@svg:animation|',
'@svg:stop^@svg:|',
'@svg:style^@svg:|!disabled,media,title,type',
'@svg:switch^@svg:graphics|',
'@svg:symbol^@svg:|',
'@svg:tspan^@svg:textPositioning|',
'@svg:text^@svg:textPositioning|',
'@svg:textPath^@svg:textContent|',
'@svg:title^@svg:|',
'@svg:use^@svg:graphics|',
'@svg:view^@svg:|#zoomAndPan'
]);
/*@ts2dart_const*/ ([
'*|%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop',
'^*|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*autocomplete,*autocompleteerror,*beforecopy,*beforecut,*beforepaste,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*message,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*paste,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*search,*seeked,*seeking,*select,*selectstart,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate',
'media|!autoplay,!controls,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,#playbackRate,preload,src,#volume',
'@svg:^*|*abort,*autocomplete,*autocompleteerror,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex',
'@svg:graphics^@svg:|',
'@svg:animation^@svg:|*begin,*end,*repeat',
'@svg:geometry^@svg:|',
'@svg:componentTransferFunction^@svg:|',
'@svg:gradient^@svg:|',
'@svg:textContent^@svg:graphics|',
'@svg:textPositioning^@svg:textContent|',
'a|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,rel,rev,search,shape,target,text,type,username',
'area|alt,coords,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,search,shape,target,username',
'audio^media|',
'br|clear',
'base|href,target',
'body|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink',
'button|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',
'canvas|#height,#width',
'content|select',
'dl|!compact',
'datalist|',
'details|!open',
'dialog|!open,returnValue',
'dir|!compact',
'div|align',
'embed|align,height,name,src,type,width',
'fieldset|!disabled,name',
'font|color,face,size',
'form|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',
'frame|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src',
'frameset|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows',
'hr|align,color,!noShade,size,width',
'head|',
'h1,h2,h3,h4,h5,h6|align',
'html|version',
'iframe|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,%sandbox,scrolling,src,srcdoc,width',
'img|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,sizes,src,srcset,useMap,#vspace,#width',
'input|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width',
'keygen|!autofocus,challenge,!disabled,keytype,name',
'li|type,#value',
'label|htmlFor',
'legend|align',
'link|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type',
'map|name',
'marquee|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',
'menu|!compact',
'meta|content,httpEquiv,name,scheme',
'meter|#high,#low,#max,#min,#optimum,#value',
'ins,del|cite,dateTime',
'ol|!compact,!reversed,#start,type',
'object|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',
'optgroup|!disabled,label',
'option|!defaultSelected,!disabled,label,!selected,text,value',
'output|defaultValue,%htmlFor,name,value',
'p|align',
'param|name,type,value,valueType',
'picture|',
'pre|#width',
'progress|#max,#value',
'q,blockquote,cite|',
'script|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',
'select|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',
'shadow|',
'source|media,sizes,src,srcset,type',
'span|',
'style|!disabled,media,type',
'caption|align',
'th,td|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',
'col,colgroup|align,ch,chOff,#span,vAlign,width',
'table|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',
'tr|align,bgColor,ch,chOff,vAlign',
'tfoot,thead,tbody|align,ch,chOff,vAlign',
'template|',
'textarea|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',
'title|text',
'track|!default,kind,label,src,srclang',
'ul|!compact,type',
'unknown|',
'video^media|#height,poster,#width',
'@svg:a^@svg:graphics|',
'@svg:animate^@svg:animation|',
'@svg:animateMotion^@svg:animation|',
'@svg:animateTransform^@svg:animation|',
'@svg:circle^@svg:geometry|',
'@svg:clipPath^@svg:graphics|',
'@svg:cursor^@svg:|',
'@svg:defs^@svg:graphics|',
'@svg:desc^@svg:|',
'@svg:discard^@svg:|',
'@svg:ellipse^@svg:geometry|',
'@svg:feBlend^@svg:|',
'@svg:feColorMatrix^@svg:|',
'@svg:feComponentTransfer^@svg:|',
'@svg:feComposite^@svg:|',
'@svg:feConvolveMatrix^@svg:|',
'@svg:feDiffuseLighting^@svg:|',
'@svg:feDisplacementMap^@svg:|',
'@svg:feDistantLight^@svg:|',
'@svg:feDropShadow^@svg:|',
'@svg:feFlood^@svg:|',
'@svg:feFuncA^@svg:componentTransferFunction|',
'@svg:feFuncB^@svg:componentTransferFunction|',
'@svg:feFuncG^@svg:componentTransferFunction|',
'@svg:feFuncR^@svg:componentTransferFunction|',
'@svg:feGaussianBlur^@svg:|',
'@svg:feImage^@svg:|',
'@svg:feMerge^@svg:|',
'@svg:feMergeNode^@svg:|',
'@svg:feMorphology^@svg:|',
'@svg:feOffset^@svg:|',
'@svg:fePointLight^@svg:|',
'@svg:feSpecularLighting^@svg:|',
'@svg:feSpotLight^@svg:|',
'@svg:feTile^@svg:|',
'@svg:feTurbulence^@svg:|',
'@svg:filter^@svg:|',
'@svg:foreignObject^@svg:graphics|',
'@svg:g^@svg:graphics|',
'@svg:image^@svg:graphics|',
'@svg:line^@svg:geometry|',
'@svg:linearGradient^@svg:gradient|',
'@svg:mpath^@svg:|',
'@svg:marker^@svg:|',
'@svg:mask^@svg:|',
'@svg:metadata^@svg:|',
'@svg:path^@svg:geometry|',
'@svg:pattern^@svg:|',
'@svg:polygon^@svg:geometry|',
'@svg:polyline^@svg:geometry|',
'@svg:radialGradient^@svg:gradient|',
'@svg:rect^@svg:geometry|',
'@svg:svg^@svg:graphics|#currentScale,#zoomAndPan',
'@svg:script^@svg:|type',
'@svg:set^@svg:animation|',
'@svg:stop^@svg:|',
'@svg:style^@svg:|!disabled,media,title,type',
'@svg:switch^@svg:graphics|',
'@svg:symbol^@svg:|',
'@svg:tspan^@svg:textPositioning|',
'@svg:text^@svg:textPositioning|',
'@svg:textPath^@svg:textContent|',
'@svg:title^@svg:|',
'@svg:use^@svg:graphics|',
'@svg:view^@svg:|#zoomAndPan'
]);
var attrToPropMap: {[name: string]: string} = <any>{
'class': 'className',

View File

@ -2,4 +2,3 @@ export class ElementSchemaRegistry {
hasProperty(tagName: string, propName: string): boolean { return true; }
getMappedPropName(propName: string): string { return propName; }
}

View File

@ -1,8 +1,5 @@
import {ViewEncapsulation, Injectable} from '@angular/core';
import {
CompileIdentifierMetadata,
CompileDirectiveMetadata
} from './compile_metadata';
import {CompileIdentifierMetadata, CompileDirectiveMetadata} from './compile_metadata';
import * as o from './output/output_ast';
import {ShadowCss} from './shadow_css';
import {UrlResolver} from './url_resolver';

View File

@ -70,7 +70,7 @@ export class ValueTransformer implements ValueVisitor {
visitOther(value: any, context: any): any { return value; }
}
export function assetUrl(pkg: string, path: string = null, type:string = 'src'): string {
export function assetUrl(pkg: string, path: string = null, type: string = 'src'): string {
if (IS_DART) {
if (path == null) {
return `asset:angular2/${pkg}/${pkg}.dart`;

View File

@ -4,10 +4,7 @@ import {ListWrapper} from '../../src/facade/collection';
import * as o from '../output/output_ast';
import {Identifiers} from '../identifiers';
import {
CompileQueryMetadata,
CompileTokenMap
} from '../compile_metadata';
import {CompileQueryMetadata, CompileTokenMap} from '../compile_metadata';
import {CompileView} from './compile_view';
import {CompileElement} from './compile_element';

View File

@ -20,7 +20,8 @@ import {
getViewFactoryName,
injectFromViewParentInjector,
createDiTokenExpression,
getPropertyInView, createPureProxy
getPropertyInView,
createPureProxy
} from './util';
import {CompilerConfig} from '../config';
import {CompileBinding} from './compile_binding';

View File

@ -5,9 +5,7 @@ import {
reflector,
} from '@angular/core';
import {
ReflectorReader
} from '../core_private';
import {ReflectorReader} from '../core_private';
import {Type, stringify, isBlank, isPresent} from '../src/facade/lang';
import {BaseException} from '../src/facade/exceptions';

View File

@ -17,7 +17,7 @@ export function emit(): Promise<string> {
// Generator
export function main(args: string[]) {
emit().then((source) => {
// debug: console.error(source);
print(source);
});
// debug: console.error(source);
print(source);
});
}

View File

@ -15,7 +15,7 @@ export function emit() {
// Generator
export function main(args: string[]) {
emit().then((source) => {
// debug: console.error(source);
print(source);
});
// debug: console.error(source);
print(source);
});
}

View File

@ -15,8 +15,8 @@ export function getExpressions(): any {
export function emit() {
var emitter = IS_DART ? new DartEmitter() : new TypeScriptEmitter();
var emittedCode =
emitter.emitStatements(assetUrl('compiler', 'output/output_emitter_codegen_typed', 'test'),
codegenStmts, codegenExportsVars);
emitter.emitStatements(assetUrl('compiler', 'output/output_emitter_codegen_typed', 'test'),
codegenStmts, codegenExportsVars);
return emittedCode;
}

View File

@ -10,12 +10,11 @@ export function getExpressions(): any {
}
// Generator
export function emit () {
export function emit() {
var emitter = new JavaScriptEmitter();
var emittedCode =
emitter.emitStatements(
assetUrl('compiler', 'output/output_emitter_codegen_untyped', 'test'),
codegenStmts, codegenExportsVars);
emitter.emitStatements(assetUrl('compiler', 'output/output_emitter_codegen_untyped', 'test'),
codegenStmts, codegenExportsVars);
return emittedCode;
}

View File

@ -20,9 +20,12 @@ import {EventEmitter} from '@angular/core';
import {ViewType} from '@angular/core/src/linker/view_type';
import {BaseException} from '@angular/core';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {browserDetection} from '@angular/platform-browser/testing'
import {
browserDetection
} from '@angular/platform-browser/testing'
export function main() {
export function
main() {
var outputDefs = [];
outputDefs.push({
'getExpressions': () => interpretStatements(codegenStmts, 'getExpressions',

View File

@ -19,11 +19,8 @@ var testDataIdentifier = new CompileIdentifierMetadata({
runtime: ExternalClass
});
var eventEmitterIdentifier = new CompileIdentifierMetadata({
name: 'EventEmitter',
moduleUrl: assetUrl('core'),
runtime: EventEmitter
});
var eventEmitterIdentifier = new CompileIdentifierMetadata(
{name: 'EventEmitter', moduleUrl: assetUrl('core'), runtime: EventEmitter});
var enumIdentifier = new CompileIdentifierMetadata({
name: 'ViewType.HOST',
@ -31,11 +28,8 @@ var enumIdentifier = new CompileIdentifierMetadata({
runtime: ViewType.HOST
});
var baseExceptionIdentifier = new CompileIdentifierMetadata({
name: 'BaseException',
moduleUrl: assetUrl('core'),
runtime: BaseException
});
var baseExceptionIdentifier = new CompileIdentifierMetadata(
{name: 'BaseException', moduleUrl: assetUrl('core'), runtime: BaseException});
export var codegenExportsVars = [
'getExpressions',

View File

@ -16,17 +16,27 @@ import {
ComponentFixtureNoNgZone
} from '@angular/compiler/testing';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {Injectable, provide, Component, Input, ViewMetadata, ComponentResolver} from '@angular/core';
import {
Injectable,
provide,
Component,
Input,
ViewMetadata,
ComponentResolver
} from '@angular/core';
import {NgIf} from '@angular/common';
import {IS_DART} from '../src/facade/lang';
import {PromiseWrapper} from '../src/facade/promise';
import {dispatchEvent} from "@angular/platform-browser/testing";
import {withProviders} from "@angular/core/testing/test_injector"
import {
withProviders
} from "@angular/core/testing/test_injector"
@Component(
{selector: 'child-comp', template: `<span>Original {{childBinding}}</span>`, directives: []})
@Injectable()
class ChildComp {
@Component({
selector: 'child-comp',
template: `<span>Original {{childBinding}}</span>`,
directives: []
}) @Injectable() class ChildComp {
childBinding: string;
constructor() { this.childBinding = 'Child'; }
}

View File

@ -1,12 +1,5 @@
import {NgZone, NgZoneError} from './zone/ng_zone';
import {
Type,
isBlank,
isPresent,
assertionsEnabled,
lockMode,
isPromise
} from '../src/facade/lang';
import {Type, isBlank, isPresent, assertionsEnabled, lockMode, isPromise} from '../src/facade/lang';
import {Injector, Injectable} from './di';
import {PLATFORM_INITIALIZER, APP_INITIALIZER} from './application_tokens';
import {PromiseWrapper, ObservableWrapper} from '../src/facade/async';
@ -14,11 +7,7 @@ import {ListWrapper} from '../src/facade/collection';
import {TestabilityRegistry, Testability} from './testability/testability';
import {ComponentResolver} from './linker/component_resolver';
import {ComponentRef, ComponentFactory} from './linker/component_factory';
import {
BaseException,
ExceptionHandler,
unimplemented
} from '../src/facade/exceptions';
import {BaseException, ExceptionHandler, unimplemented} from '../src/facade/exceptions';
import {Console} from './console';
import {wtfLeave, wtfCreateScope, WtfScopeFn} from './profile/profile';
import {ChangeDetectorRef} from './change_detection/change_detector_ref';

View File

@ -1,8 +1,5 @@
import {looseIdentical, isPrimitive} from '../../src/facade/lang';
import {
isListLikeIterable,
areIterablesEqual
} from '../../src/facade/collection';
import {isListLikeIterable, areIterablesEqual} from '../../src/facade/collection';
export {looseIdentical} from '../../src/facade/lang';
export var uninitialized: Object = /*@ts2dart_const*/ new Object();

View File

@ -1,10 +1,5 @@
import {isPresent} from '../../src/facade/lang';
import {
Renderer,
RootRenderer,
RenderComponentType,
RenderDebugInfo
} from '../render/api';
import {Renderer, RootRenderer, RenderComponentType, RenderDebugInfo} from '../render/api';
import {
DebugNode,
DebugElement,

View File

@ -1,11 +1,4 @@
import {
normalizeBool,
Type,
isType,
isBlank,
isFunction,
stringify
} from '../../src/facade/lang';
import {normalizeBool, Type, isType, isBlank, isFunction, stringify} from '../../src/facade/lang';
import {BaseException} from '../../src/facade/exceptions';
/**

View File

@ -1,8 +1,4 @@
import {
isBlank,
isPresent,
looseIdentical
} from '../../src/facade/lang';
import {isBlank, isPresent, looseIdentical} from '../../src/facade/lang';
import {ListWrapper, StringMapWrapper} from '../../src/facade/collection';
import {BaseException} from '../../src/facade/exceptions';
import {AppElement} from './element';

View File

@ -1,11 +1,4 @@
import {
Type,
isPresent,
isFunction,
global,
stringify,
ConcreteType
} from '../../src/facade/lang';
import {Type, isPresent, isFunction, global, stringify, ConcreteType} from '../../src/facade/lang';
import {BaseException} from '../../src/facade/exceptions';
import {GetterFn, SetterFn, MethodFn} from './types';
import {PlatformReflectionCapabilities} from './platform_reflection_capabilities';

View File

@ -294,7 +294,8 @@ export function main() {
var childTestEls = fixture.debugElement.queryAll(By.css('child-comp'));
expect(childTestEls.length).toBe(1);
expect(getDOM().hasClass(childTestEls[0].nativeElement, 'child-comp-class')).toBe(true);
expect(getDOM().hasClass(childTestEls[0].nativeElement, 'child-comp-class'))
.toBe(true);
async.done();
});

View File

@ -1,14 +1,4 @@
import {
beforeEach,
ddescribe,
describe,
expect,
iit,
inject,
it,
xdescribe,
xit
} from '../testing';
import {beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '../testing';
import {assertionsEnabled, IS_DART} from '../../router/src/facade/lang';

View File

@ -9,7 +9,7 @@ import {
xdescribe,
xit,
} from '@angular/core/testing/testing_internal';
import { Log } from '@angular/core/testing';
import {Log} from '@angular/core/testing';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {TestComponentBuilder} from '@angular/compiler/testing';

View File

@ -23,4 +23,6 @@ export function main() {
});
}
function identity(a) { return a; }
function identity(a) {
return a;
}

View File

@ -10,12 +10,7 @@ import {
it,
xit,
} from '@angular/core/testing/testing_internal';
import {
containsRegexp,
fakeAsync,
tick,
clearPendingTimers
} from '@angular/core/testing';
import {containsRegexp, fakeAsync, tick, clearPendingTimers} from '@angular/core/testing';
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
@ -163,14 +158,14 @@ function declareTests(isJit: boolean) {
.then((fixture) => {
fixture.debugElement.componentInstance.ctxProp = 'Initial aria label';
fixture.detectChanges();
expect(
getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'aria-label'))
expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement,
'aria-label'))
.toEqual('Initial aria label');
fixture.debugElement.componentInstance.ctxProp = 'Changed aria label';
fixture.detectChanges();
expect(
getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'aria-label'))
expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement,
'aria-label'))
.toEqual('Changed aria label');
async.done();
@ -187,12 +182,14 @@ function declareTests(isJit: boolean) {
fixture.debugElement.componentInstance.ctxProp = 'bar';
fixture.detectChanges();
expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'foo'))
expect(
getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'foo'))
.toEqual('bar');
fixture.debugElement.componentInstance.ctxProp = null;
fixture.detectChanges();
expect(getDOM().hasAttribute(fixture.debugElement.children[0].nativeElement, 'foo'))
expect(
getDOM().hasAttribute(fixture.debugElement.children[0].nativeElement, 'foo'))
.toBeFalsy();
async.done();
@ -1087,7 +1084,8 @@ function declareTests(isJit: boolean) {
.then((fixture) => {
fixture.detectChanges();
expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, "role"))
expect(
getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, "role"))
.toEqual("button");
async.done();
@ -1136,9 +1134,9 @@ function declareTests(isJit: boolean) {
var dispatchedEvent = getDOM().createMouseEvent('click');
var dispatchedEvent2 = getDOM().createMouseEvent('click');
getDOM().dispatchEvent(fixture.debugElement.children[0].nativeElement,
dispatchedEvent);
dispatchedEvent);
getDOM().dispatchEvent(fixture.debugElement.children[1].nativeElement,
dispatchedEvent2);
dispatchedEvent2);
expect(getDOM().isPrevented(dispatchedEvent)).toBe(true);
expect(getDOM().isPrevented(dispatchedEvent2)).toBe(false);
expect(getDOM().getChecked(fixture.debugElement.children[0].nativeElement))
@ -1379,7 +1377,8 @@ function declareTests(isJit: boolean) {
}))
.createAsync(MyComp)
.then((fixture) => {
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'script').length)
expect(
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'script').length)
.toEqual(0);
async.done();
});
@ -2531,7 +2530,8 @@ class DuplicateDir {
@Directive({selector: '[no-duplicate]'})
class OtherDuplicateDir {
constructor(elRef: ElementRef) {
getDOM().setText(elRef.nativeElement, getDOM().getText(elRef.nativeElement) + 'othernoduplicate');
getDOM().setText(elRef.nativeElement,
getDOM().getText(elRef.nativeElement) + 'othernoduplicate');
}
}

View File

@ -269,18 +269,18 @@ export function main() {
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
var template = '<needs-tpl><template><div>light</div></template></needs-tpl>';
tcb.overrideTemplate(MyComp0, template)
.createAsync(MyComp0)
.then((view) => {
view.detectChanges();
var needsTpl: NeedsTpl = view.debugElement.children[0].inject(NeedsTpl);
.createAsync(MyComp0)
.then((view) => {
view.detectChanges();
var needsTpl: NeedsTpl = view.debugElement.children[0].inject(NeedsTpl);
expect(needsTpl.vc.createEmbeddedView(needsTpl.query.first).rootNodes[0])
.toHaveText('light');
expect(needsTpl.vc.createEmbeddedView(needsTpl.viewQuery.first).rootNodes[0])
.toHaveText('shadow');
expect(needsTpl.vc.createEmbeddedView(needsTpl.query.first).rootNodes[0])
.toHaveText('light');
expect(needsTpl.vc.createEmbeddedView(needsTpl.viewQuery.first).rootNodes[0])
.toHaveText('shadow');
async.done();
});
async.done();
});
}));
it('should find named TemplateRefs',
@ -866,7 +866,9 @@ class NeedsViewChild implements AfterViewInit,
ngAfterViewInit() { this.logs.push(["init", isPresent(this.child) ? this.child.text : null]); }
ngAfterViewChecked() { this.logs.push(["check", isPresent(this.child) ? this.child.text : null]); }
ngAfterViewChecked() {
this.logs.push(["check", isPresent(this.child) ? this.child.text : null]);
}
}
@Directive({selector: '[dir]'})

View File

@ -10,13 +10,7 @@ import {
beforeEachProviders,
inject,
} from '@angular/core/testing/testing_internal';
import {
fakeAsync,
flushMicrotasks,
Log,
tick,
containsRegexp
} from '@angular/core/testing';
import {fakeAsync, flushMicrotasks, Log, tick, containsRegexp} from '@angular/core/testing';
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
import {isBlank} from '../../src/facade/lang';
import {

View File

@ -19,9 +19,11 @@ import {
HasGetterAndSetterDecorators
} from './reflector_common';
import {IS_DART} from '../../src/facade/lang';
import {browserDetection} from '@angular/platform-browser/testing'
import {
browserDetection
} from '@angular/platform-browser/testing'
class AType {
class AType {
value;
constructor(value) { this.value = value; }

View File

@ -1,13 +1,4 @@
import {
describe,
it,
iit,
ddescribe,
expect,
tick,
beforeEach,
containsRegexp
} from '../testing';
import {describe, it, iit, ddescribe, expect, tick, beforeEach, containsRegexp} from '../testing';
import {SpyObject} from '@angular/core/testing/testing_internal';
import {MapWrapper} from '../../platform-browser/src/facade/collection';

View File

@ -9,9 +9,7 @@ import {
xdescribe,
xit,
} from '@angular/core/testing/testing_internal';
import {
Log
} from '@angular/core/testing';
import {Log} from '@angular/core/testing';
import {
PromiseCompleter,

View File

@ -5,7 +5,7 @@ import {
ComponentFactory,
Injector,
NgZone,
Type
Type
} from '../index';
/**

View File

@ -1,10 +1,9 @@
import {RegExpWrapper, StringWrapper} from '../src/facade/lang';
var _RE_SPECIAL_CHARS =
['-', '[', ']', '/', '{', '}', '\\', '(', ')', '*', '+', '?', '.', '^', '$', '|'];
['-', '[', ']', '/', '{', '}', '\\', '(', ')', '*', '+', '?', '.', '^', '$', '|'];
var _ESCAPE_RE = RegExpWrapper.create(`[\\${_RE_SPECIAL_CHARS.join('\\')}]`);
export function containsRegexp(input: string): RegExp {
return RegExpWrapper.create(
StringWrapper.replaceAllMapped(input, _ESCAPE_RE, (match) => `\\${match[0]}`));
StringWrapper.replaceAllMapped(input, _ESCAPE_RE, (match) => `\\${match[0]}`));
}

View File

@ -2,13 +2,7 @@
* Public Test Library for unit testing Angular2 Applications. Uses the
* Jasmine framework.
*/
import {
inject,
async,
injectAsync,
TestInjector,
getTestInjector
} from './test_injector';
import {inject, async, injectAsync, TestInjector, getTestInjector} from './test_injector';
import {isPromise} from '../src/facade/lang';

View File

@ -9,7 +9,7 @@ class MyApp {
}
var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS));
var appInjector =
ReflectiveInjector.resolveAndCreate([BROWSER_APP_STATIC_PROVIDERS, appProviders], platform.injector);
var appInjector = ReflectiveInjector.resolveAndCreate([BROWSER_APP_STATIC_PROVIDERS, appProviders],
platform.injector);
coreLoadAndBootstrap(appInjector, MyApp);
// #enddocregion

View File

@ -1,11 +1,4 @@
import {
isJsObject,
global,
isPresent,
isBlank,
isArray,
getSymbolIterator
} from './lang';
import {isJsObject, global, isPresent, isBlank, isArray, getSymbolIterator} from './lang';
export var Map = global.Map;
export var Set = global.Set;

View File

@ -10,13 +10,7 @@ import {
} from '@angular/core/testing/testing_internal';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {browserDetection} from '@angular/platform-browser/testing';
import {
ObservableWrapper,
Observable,
Subject,
EventEmitter,
PromiseWrapper
} from '../src/async';
import {ObservableWrapper, Observable, Subject, EventEmitter, PromiseWrapper} from '../src/async';
export function main() {
describe('EventEmitter', () => {

View File

@ -96,10 +96,7 @@ var COMMON: string[] = [
'NgPluralCase'
];
var COMMON_TESTING: string[] = [
'MockLocationStrategy',
'SpyLocation'
];
var COMMON_TESTING: string[] = ['MockLocationStrategy', 'SpyLocation'];
var COMPILER: string[] = [
'ElementSchemaRegistry',
@ -386,7 +383,7 @@ var PLATFORM_BROWSER: string[] = [
var PLATFORM_BROWSER_TESTING: string[] = [
'TEST_BROWSER_STATIC_APPLICATION_PROVIDERS',
'TEST_BROWSER_STATIC_PLATFORM_PROVIDERS',
'ADDITIONAL_TEST_BROWSER_PROVIDERS', // This should be made private
'ADDITIONAL_TEST_BROWSER_PROVIDERS', // This should be made private
'BrowserDetection',
'DOMTestComponentRenderer',
'TestComponentRenderer',
@ -406,19 +403,13 @@ var PLATFORM_BROWSER_DYNAMIC: string[] = [
'UrlChangeListener:dart'
];
var PLATFORM_BROWSER_DYNAMIC_TESTING: string[] = [
'TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS',
'TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS'
];
var PLATFORM_BROWSER_DYNAMIC_TESTING: string[] =
['TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS', 'TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS'];
var PLATFORM_SERVER: string[] = [
'Parse5DomAdapter'
];
var PLATFORM_SERVER: string[] = ['Parse5DomAdapter'];
var PLATFORM_SERVER_TESTING: string[] = [
'TEST_SERVER_APPLICATION_PROVIDERS',
'TEST_SERVER_PLATFORM_PROVIDERS'
];
var PLATFORM_SERVER_TESTING: string[] =
['TEST_SERVER_APPLICATION_PROVIDERS', 'TEST_SERVER_PLATFORM_PROVIDERS'];
var UPGRADE: string[] = [
'UpgradeAdapter',
@ -452,10 +443,7 @@ var HTTP: string[] = [
'XHRConnection'
];
var HTTP_TESTING: string[] = [
'MockBackend',
'MockConnection'
];
var HTTP_TESTING: string[] = ['MockBackend', 'MockConnection'];
var ROUTER: string[] = [
'AsyncRoute',
@ -480,8 +468,7 @@ var ROUTER: string[] = [
'RouterOutlet'
];
var ROUTER_TESTING: string[] = [
];
var ROUTER_TESTING: string[] = [];
var API = {

View File

@ -9,16 +9,17 @@ import {getDOM} from './platform_browser_private';
import {ReflectionCapabilities} from './core_private';
export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/ [{provide: XHR, useClass: CachedXHR}];
/*@ts2dart_const*/[{provide: XHR, useClass: CachedXHR}];
/**
* An array of providers that should be passed into `application()` when bootstrapping a component.
*/
export const BROWSER_APP_DYNAMIC_PROVIDERS: Array<any /*Type | Provider | any[]*/> = /*@ts2dart_const*/ [
BROWSER_APP_COMMON_PROVIDERS,
COMPILER_PROVIDERS,
{provide: XHR, useClass: XHRImpl},
];
export const BROWSER_APP_DYNAMIC_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/[
BROWSER_APP_COMMON_PROVIDERS,
COMPILER_PROVIDERS,
{provide: XHR, useClass: XHRImpl},
];
@ -91,11 +92,11 @@ export const BROWSER_APP_DYNAMIC_PROVIDERS: Array<any /*Type | Provider | any[]*
* Returns a `Promise` of {@link ComponentRef}.
*/
export function bootstrap(
appComponentType: Type,
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
appComponentType: Type,
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
reflector.reflectionCapabilities = new ReflectionCapabilities();
var appInjector = ReflectiveInjector.resolveAndCreate(
[BROWSER_APP_DYNAMIC_PROVIDERS, isPresent(customProviders) ? customProviders : []],
browserPlatform().injector);
[BROWSER_APP_DYNAMIC_PROVIDERS, isPresent(customProviders) ? customProviders : []],
browserPlatform().injector);
return coreLoadAndBootstrap(appInjector, appComponentType);
}

View File

@ -1,4 +1,4 @@
import {__platform_browser_private__ as _} from '@angular/platform-browser';
export type DomAdapter = _.DomAdapter;
export function getDOM(): _.DomAdapter { return _.getDOM() };
export function getDOM(): _.DomAdapter{return _.getDOM()};

View File

@ -9,10 +9,10 @@ import {BROWSER_APP_DYNAMIC_PROVIDERS} from '../index';
* Default platform providers for testing.
*/
export const TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/ [TEST_BROWSER_STATIC_PLATFORM_PROVIDERS];
/*@ts2dart_const*/[TEST_BROWSER_STATIC_PLATFORM_PROVIDERS];
/**
* Default application providers for testing.
*/
export const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/ [BROWSER_APP_DYNAMIC_PROVIDERS, ADDITIONAL_TEST_BROWSER_PROVIDERS];
/*@ts2dart_const*/[BROWSER_APP_DYNAMIC_PROVIDERS, ADDITIONAL_TEST_BROWSER_PROVIDERS];

View File

@ -4,6 +4,7 @@ export type RenderDebugInfo = t.RenderDebugInfo;
export var RenderDebugInfo: typeof t.RenderDebugInfo = r.RenderDebugInfo;
export var wtfInit: typeof t.wtfInit = r.wtfInit;
export var ReflectionCapabilities: typeof t.ReflectionCapabilities = r.ReflectionCapabilities;
export var VIEW_ENCAPSULATION_VALUES: typeof t.VIEW_ENCAPSULATION_VALUES = r.VIEW_ENCAPSULATION_VALUES;
export var VIEW_ENCAPSULATION_VALUES: typeof t.VIEW_ENCAPSULATION_VALUES =
r.VIEW_ENCAPSULATION_VALUES;
export type DebugDomRootRenderer = t.DebugDomRootRenderer;
export var DebugDomRootRenderer: typeof t.DebugDomRootRenderer = r.DebugDomRootRenderer;

View File

@ -11,13 +11,9 @@ export namespace __platform_browser_private__ {
export type DomAdapter = dom_adapter.DomAdapter;
export var DomAdapter = dom_adapter.DomAdapter;
export function getDOM():DomAdapter{
return dom_adapter.getDOM();
}
export function getDOM(): DomAdapter { return dom_adapter.getDOM(); }
export function setDOM(adapter:DomAdapter){
return dom_adapter.setDOM(adapter);
}
export function setDOM(adapter: DomAdapter) { return dom_adapter.setDOM(adapter); }
export var setRootDomAdapter = dom_adapter.setRootDomAdapter;
@ -27,7 +23,7 @@ export namespace __platform_browser_private__ {
export type AnimationBuilder = animation_builder.AnimationBuilder;
export var AnimationBuilder = animation_builder.AnimationBuilder;
export type CssAnimationBuilder = css_animation_builder.CssAnimationBuilder
export type CssAnimationBuilder = css_animation_builder.CssAnimationBuilder;
export var CssAnimationBuilder = css_animation_builder.CssAnimationBuilder;
export type CssAnimationOptions = css_animation_options.CssAnimationOptions;

View File

@ -120,7 +120,8 @@ export class Animation {
* @param classes
*/
removeClasses(classes: string[]): void {
for (let i = 0, len = classes.length; i < len; i++) getDOM().removeClass(this.element, classes[i]);
for (let i = 0, len = classes.length; i < len; i++)
getDOM().removeClass(this.element, classes[i]);
}
/**
@ -128,8 +129,9 @@ export class Animation {
*/
addEvents(): void {
if (this.totalTime > 0) {
this.eventClearFunctions.push(getDOM().onAndCancel(
this.element, getDOM().getTransitionEnd(), (event: any) => this.handleAnimationEvent(event)));
this.eventClearFunctions.push(
getDOM().onAndCancel(this.element, getDOM().getTransitionEnd(),
(event: any) => this.handleAnimationEvent(event)));
} else {
this.handleAnimationCompleted();
}

View File

@ -14,7 +14,8 @@ export class BrowserDetails {
*/
doesElapsedTimeIncludesDelay(): void {
var div = getDOM().createElement('div');
getDOM().setAttribute(div, 'style', `position: absolute; top: -9999px; left: -9999px; width: 1px;
getDOM().setAttribute(div, 'style',
`position: absolute; top: -9999px; left: -9999px; width: 1px;
height: 1px; transition: all 1ms linear 1ms;`);
// Firefox requires that we wait for 2 frames for some reason
this.raf((timestamp: any) => {

View File

@ -28,7 +28,7 @@ import {
HAMMER_GESTURE_CONFIG,
HammerGestureConfig,
HammerGesturesPlugin
} from './dom/events/hammer_gestures'
} from './dom/events/hammer_gestures';
import {DomSharedStylesHost} from './dom/shared_styles_host';
import {AnimationBuilder} from './animate/animation_builder';
import {BrowserDetails} from './animate/browser_details';
@ -97,7 +97,8 @@ export {
} from '../src/dom/events/hammer_gestures'
export function initDomAdapter() {
export function
initDomAdapter() {
BrowserDomAdapter.makeCurrent();
wtfInit();
BrowserGetTestability.init();

View File

@ -1,4 +1,11 @@
import {DebugNode, getDebugNode, Provider, RootRenderer, NgZone, ApplicationRef} from '@angular/core';
import {
DebugNode,
getDebugNode,
Provider,
RootRenderer,
NgZone,
ApplicationRef
} from '@angular/core';
import {DebugDomRootRenderer} from '../../../core_private';
import {assertionsEnabled} from '../../facade/lang';
import {getDOM} from '../dom_adapter';

View File

@ -2,11 +2,11 @@ import {isBlank, Type} from '../../src/facade/lang';
var _DOM: DomAdapter = null;
export function getDOM(){
export function getDOM() {
return _DOM;
}
export function setDOM(adapter:DomAdapter){
export function setDOM(adapter: DomAdapter) {
_DOM = adapter;
}

View File

@ -7,7 +7,7 @@ import {
RenderComponentType,
ViewEncapsulation
} from '@angular/core';
import {RenderDebugInfo} from '../../core_private'
import {RenderDebugInfo} from '../../core_private';
import {AnimationBuilder} from '../animate/animation_builder';
import {
isPresent,
@ -201,11 +201,12 @@ export class DomRenderer implements Renderer {
var dashCasedPropertyName = camelCaseToDashCase(propertyName);
if (getDOM().isCommentNode(renderElement)) {
var existingBindings = RegExpWrapper.firstMatch(
TEMPLATE_BINDINGS_EXP, StringWrapper.replaceAll(getDOM().getText(renderElement), /\n/g, ''));
TEMPLATE_BINDINGS_EXP,
StringWrapper.replaceAll(getDOM().getText(renderElement), /\n/g, ''));
var parsedBindings = Json.parse(existingBindings[1]);
parsedBindings[dashCasedPropertyName] = propertyValue;
getDOM().setText(renderElement, StringWrapper.replace(TEMPLATE_COMMENT_TEXT, '{}',
Json.stringify(parsedBindings)));
Json.stringify(parsedBindings)));
} else {
this.setElementAttribute(renderElement, propertyName, propertyValue);
}

View File

@ -33,7 +33,7 @@ export class KeyEventsPlugin extends EventManagerPlugin {
return this.manager.getZone().runOutsideAngular(() => {
return getDOM().onAndCancel(element, StringMapWrapper.get(parsedEvent, 'domEventName'),
outsideHandler);
outsideHandler);
});
}

View File

@ -9,7 +9,11 @@ import {
} from '@angular/core';
import {Type, isPresent, isBlank} from './facade/lang';
import {BROWSER_APP_COMMON_PROVIDERS, BROWSER_PROVIDERS, BROWSER_PLATFORM_MARKER} from './browser_common';
import {
BROWSER_APP_COMMON_PROVIDERS,
BROWSER_PROVIDERS,
BROWSER_PLATFORM_MARKER
} from './browser_common';
export {ELEMENT_PROBE_PROVIDERS} from './dom/debug/ng_probe';
export {BrowserPlatformLocation} from './browser/location/browser_platform_location';
export {
@ -45,8 +49,8 @@ export function bootstrapStatic(appComponentType: Type,
initReflector();
}
let appProviders =
isPresent(customProviders) ? [BROWSER_APP_STATIC_PROVIDERS, customProviders] : BROWSER_APP_STATIC_PROVIDERS;
let appProviders = isPresent(customProviders) ? [BROWSER_APP_STATIC_PROVIDERS, customProviders] :
BROWSER_APP_STATIC_PROVIDERS;
var appInjector =
ReflectiveInjector.resolveAndCreate(appProviders, browserStaticPlatform().injector);
return coreLoadAndBootstrap(appInjector, appComponentType);

View File

@ -4,10 +4,7 @@ import {
import {UrlChangeListener} from '@angular/common';
import {Injectable} from '@angular/core/src/di';
import {ROUTER_CHANNEL} from '../shared/messaging_api';
import {
ServiceMessageBrokerFactory,
ServiceMessageBroker
} from '../shared/service_message_broker';
import {ServiceMessageBrokerFactory, ServiceMessageBroker} from '../shared/service_message_broker';
import {PRIMITIVE, Serializer} from '../shared/serializer';
import {bind} from './bind';
import {LocationType} from '../shared/serialized_types';

View File

@ -34,7 +34,9 @@ import {
ClientMessageBrokerFactory,
ClientMessageBrokerFactory_
} from '../web_workers/shared/client_message_broker';
import {BrowserPlatformLocation} from '@angular/platform-browser/src/browser/location/browser_platform_location';
import {
BrowserPlatformLocation
} from '@angular/platform-browser/src/browser/location/browser_platform_location';
import {Serializer} from '../web_workers/shared/serializer';
import {ON_WEB_WORKER} from '../web_workers/shared/api';
import {RenderStore} from '../web_workers/shared/render_store';

View File

@ -12,10 +12,7 @@ import {
assertPlatform
} from '@angular/core';
export {
WORKER_APP_PLATFORM,
WORKER_APP_APPLICATION_COMMON
} from './webworker/worker_app_common';
export {WORKER_APP_PLATFORM, WORKER_APP_APPLICATION_COMMON} from './webworker/worker_app_common';
export {WORKER_APP_APPLICATION} from './webworker/worker_app';
export {
ClientMessageBroker,

View File

@ -216,9 +216,10 @@ export function main() {
it('should unregister change detectors when components are disposed',
inject([AsyncTestCompleter], (async) => {
var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS));
var app = ReflectiveInjector.resolveAndCreate([BROWSER_APP_DYNAMIC_PROVIDERS, testProviders],
platform.injector)
.get(ApplicationRef);
var app =
ReflectiveInjector.resolveAndCreate([BROWSER_APP_DYNAMIC_PROVIDERS, testProviders],
platform.injector)
.get(ApplicationRef);
coreLoadAndBootstrap(app.injector, HelloRootCmp)
.then((ref) => {
ref.destroy();

View File

@ -12,7 +12,10 @@ import {DomEventsPlugin} from '@angular/platform-browser/src/dom/events/dom_even
import {NgZone} from '@angular/core/src/zone/ng_zone';
import {ListWrapper, Map} from '../../../src/facade/collection';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {EventManager, EventManagerPlugin} from '@angular/platform-browser/src/dom/events/event_manager';
import {
EventManager,
EventManagerPlugin
} from '@angular/platform-browser/src/dom/events/event_manager';
import {el} from '../../../testing/browser_util';
export function main() {

View File

@ -66,7 +66,7 @@ export function main() {
describe('test APIs for the browser', () => {
describe('angular2 jasmine matchers', () => {
describe('toHaveCssClass', () => {
it('should assert that the CSS class is present', () => {
it('should assert that the CSS class is present', () => {
var el = document.createElement('div');
el.classList.add('matias');
expect(el).toHaveCssClass('matias');

View File

@ -8,7 +8,9 @@ import {
} from '@angular/core/testing/testing_internal';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import {SpyMessageBroker} from './spies';
import {WebWorkerPlatformLocation} from '@angular/platform-browser/src/web_workers/worker/platform_location';
import {
WebWorkerPlatformLocation
} from '@angular/platform-browser/src/web_workers/worker/platform_location';
import {LocationType} from '@angular/platform-browser/src/web_workers/shared/serialized_types';
import {MessageBus} from '@angular/platform-browser/src/web_workers/shared/message_bus';
import {

View File

@ -9,8 +9,8 @@ import {
beforeEachProviders,
} from '@angular/core/testing/testing_internal';
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
import { TestInjector } from '@angular/core/testing';
import { TestComponentBuilder } from '@angular/compiler/testing';
import {TestInjector} from '@angular/core/testing';
import {TestComponentBuilder} from '@angular/compiler/testing';
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
import {
bind,
@ -89,8 +89,7 @@ export function main() {
uiRenderStore = new RenderStore();
var testUiInjector = new TestInjector();
testUiInjector.platformProviders = TEST_BROWSER_STATIC_PLATFORM_PROVIDERS;
testUiInjector.applicationProviders = TEST_BROWSER_STATIC_APPLICATION_PROVIDERS
;
testUiInjector.applicationProviders = TEST_BROWSER_STATIC_APPLICATION_PROVIDERS;
testUiInjector.addProviders([
Serializer,
provide(RenderStore, {useValue: uiRenderStore}),
@ -144,7 +143,7 @@ export function main() {
it('should update any element property/attributes/class/style independent of the compilation on the root element and other elements',
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
tcb.overrideView(MyComp2, new ViewMetadata(
{template: '<input [title]="y" style="position:absolute">'}))
{template: '<input [title]="y" style="position:absolute">'}))
.createAsync(MyComp2)
.then((fixture) => {
var checkSetters = (componentRef, workerEl) => {
@ -225,7 +224,8 @@ export function main() {
getRenderer(fixture.componentRef)
.invokeElementMethod(el.nativeElement, 'setAttribute', ['a', 'b']);
expect(getDOM().getAttribute(getRenderElement(el.nativeElement), 'a')).toEqual('b');
expect(getDOM().getAttribute(getRenderElement(el.nativeElement), 'a'))
.toEqual('b');
async.done();
});
}));

View File

@ -1,4 +1,6 @@
import {ClientMessageBroker} from '@angular/platform-browser/src/web_workers/shared/client_message_broker';
import {
ClientMessageBroker
} from '@angular/platform-browser/src/web_workers/shared/client_message_broker';
import {SpyObject, proxy} from '@angular/core/testing/testing_internal';

View File

@ -1,9 +1,9 @@
import {Injectable} from '@angular/core';
import { Animation } from '../src/animate/animation';
import { CssAnimationOptions } from '../src/animate/css_animation_options';
import { BrowserDetails } from '../src/animate/browser_details';
import { AnimationBuilder } from '../src/animate/animation_builder';
import { CssAnimationBuilder } from '../src/animate/css_animation_builder';
import {Animation} from '../src/animate/animation';
import {CssAnimationOptions} from '../src/animate/css_animation_options';
import {BrowserDetails} from '../src/animate/browser_details';
import {AnimationBuilder} from '../src/animate/animation_builder';
import {CssAnimationBuilder} from '../src/animate/css_animation_builder';
@Injectable()
export class MockAnimationBuilder extends AnimationBuilder {

View File

@ -61,7 +61,4 @@ export const ADDITIONAL_TEST_BROWSER_PROVIDERS: Array<any /*Type | Provider | an
* Default application providers for testing without a compiler.
*/
export const TEST_BROWSER_STATIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
/*@ts2dart_const*/[
BROWSER_APP_COMMON_PROVIDERS,
ADDITIONAL_TEST_BROWSER_PROVIDERS
];
/*@ts2dart_const*/[BROWSER_APP_COMMON_PROVIDERS, ADDITIONAL_TEST_BROWSER_PROVIDERS];

View File

@ -4,7 +4,7 @@ import {isPresent, isString, RegExpWrapper, StringWrapper, RegExp} from '../src/
export class BrowserDetection {
private _overrideUa: string;
private get _ua():string {
private get _ua(): string {
if (isPresent(this._overrideUa)) {
return this._overrideUa;
} else {
@ -14,9 +14,7 @@ export class BrowserDetection {
static setup() { browserDetection = new BrowserDetection(null); }
constructor(ua: string) {
this._overrideUa = ua;
}
constructor(ua: string) { this._overrideUa = ua; }
get isFirefox(): boolean { return this._ua.indexOf('Firefox') > -1; }

View File

@ -5,4 +5,3 @@ export var SelectorMatcher: typeof _.SelectorMatcher = _.SelectorMatcher;
export type CssSelector = typeof _.CssSelector;
export var CssSelector: typeof _.CssSelector = _.CssSelector;

View File

@ -2,14 +2,7 @@ var parse5 = require('parse5/index');
import {ListWrapper, StringMapWrapper} from '../src/facade/collection';
import {DomAdapter, setRootDomAdapter} from '../platform_browser_private';
import {
isPresent,
isBlank,
global,
Type,
setValueOnPath,
DateWrapper
} from '../src/facade/lang';
import {isPresent, isBlank, global, Type, setValueOnPath, DateWrapper} from '../src/facade/lang';
import {BaseException} from '../src/facade/exceptions';
import {SelectorMatcher, CssSelector} from '../compiler_private';
import {XHR} from '@angular/compiler';

View File

@ -23,7 +23,10 @@ import {DOCUMENT} from '@angular/platform-browser';
import {getDOM} from '../platform_browser_private';
import {RootRenderer} from '@angular/core';
import {DomRootRenderer, DomRootRenderer_} from '../../platform-browser/src/dom/dom_renderer';
import {DomSharedStylesHost, SharedStylesHost} from '../../platform-browser/src/dom/shared_styles_host';
import {
DomSharedStylesHost,
SharedStylesHost
} from '../../platform-browser/src/dom/shared_styles_host';
import {
EventManager,
EVENT_MANAGER_PLUGINS,

View File

@ -40,7 +40,7 @@ import {MockLocationStrategy} from '@angular/common/testing';
import {ApplicationRef} from '@angular/core/src/application_ref';
import {MockApplicationRef} from '@angular/core/testing';
//noinspection JSAnnotator
// noinspection JSAnnotator
class DummyConsole implements Console {
log(message) {}
warn(message) {}

View File

@ -197,15 +197,15 @@ export function main() {
// adapter
// can't handle css child selectors.
expect(getDOM().getAttribute(fixture.debugElement.query(By.css('book-cmp'))
.query(By.css('a'))
.nativeElement,
'href'))
.query(By.css('a'))
.nativeElement,
'href'))
.toEqual('/book/1984/page/100');
expect(getDOM().getAttribute(fixture.debugElement.query(By.css('page-cmp'))
.query(By.css('a'))
.nativeElement,
'href'))
.query(By.css('a'))
.nativeElement,
'href'))
.toEqual('/book/1984/page/2');
async.done();
});

View File

@ -34,8 +34,9 @@ export class RootCmp {
activatedCmp: any;
}
export function compile(tcb: TestComponentBuilder,
template: string = "<router-outlet></router-outlet>"): Promise<ComponentFixture<RootCmp>> {
export function compile(
tcb: TestComponentBuilder,
template: string = "<router-outlet></router-outlet>"): Promise<ComponentFixture<RootCmp>> {
return tcb.overrideTemplate(RootCmp, ('<div>' + template + '</div>')).createAsync(RootCmp);
}

View File

@ -364,7 +364,7 @@ export class UpgradeAdapter {
(injector: angular.IInjectorService, rootScope: angular.IRootScopeService) => {
ng1Injector = injector;
ngZone.onMicrotaskEmpty.subscribe(
{next: (_) => ngZone.runOutsideAngular(() => rootScope.$apply())});
{next: (_) => ngZone.runOutsideAngular(() => rootScope.$apply())});
UpgradeNg1ComponentAdapterBuilder.resolve(this.downgradedComponents, injector)
.then(resolve, reject);
}

View File

@ -2,7 +2,12 @@ import {OnInit, provide, ReflectiveInjector, ComponentResolver} from '@angular/c
import {RouterOutlet} from './directives/router_outlet';
import {Type, isBlank, isPresent} from '@angular/facade/src/lang';
import {ListWrapper} from '@angular/facade/src/collection';
import {EventEmitter, Observable, PromiseWrapper, ObservableWrapper} from '@angular/facade/src/async';
import {
EventEmitter,
Observable,
PromiseWrapper,
ObservableWrapper
} from '@angular/facade/src/async';
import {StringMapWrapper} from '@angular/facade/src/collection';
import {BaseException} from '@angular/core';
import {RouterUrlSerializer} from './router_url_serializer';

View File

@ -1,7 +1,5 @@
import {ROUTER_PROVIDERS_COMMON} from './router_providers_common';
import {
BrowserPlatformLocation
} from '@angular/platform-browser';
import {BrowserPlatformLocation} from '@angular/platform-browser';
import {PlatformLocation} from '@angular/common';
export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[

View File

@ -1,6 +1,9 @@
import {PromiseWrapper} from '@angular/facade';
import {Component} from '@angular/core';
import {ServiceMessageBrokerFactory, PRIMITIVE} from '../../../../@angular/platform-browser/src/worker_app';
import {
ServiceMessageBrokerFactory,
PRIMITIVE
} from '../../../../@angular/platform-browser/src/worker_app';
const ECHO_CHANNEL = "ECHO";

View File

@ -1,5 +1,8 @@
import {Provider} from '@angular/core';
import {bootstrapApp, WORKER_APP_ROUTER} from '../../../../@angular/platform-browser/src/worker_app';
import {
bootstrapApp,
WORKER_APP_ROUTER
} from '../../../../@angular/platform-browser/src/worker_app';
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
import {App} from './index_common';

Some files were not shown because too many files have changed in this diff Show More