chore: clang-reformat
This commit is contained in:
parent
bb8976608d
commit
3e17c99f4e
@ -1569,7 +1569,6 @@ var firstTask = true;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
gulp.on('task_start', (e) => {
|
gulp.on('task_start', (e) => {
|
||||||
if (firstTask) {
|
if (firstTask) {
|
||||||
firstTask = false;
|
firstTask = false;
|
||||||
|
@ -3,4 +3,3 @@ export * from './src/directives';
|
|||||||
export * from './src/forms';
|
export * from './src/forms';
|
||||||
export * from './src/common_directives';
|
export * from './src/common_directives';
|
||||||
export * from './src/location';
|
export * from './src/location';
|
||||||
|
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
* to read information
|
* to read information
|
||||||
* from the form DOM elements.
|
* 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';
|
export {AbstractControl, Control, ControlGroup, ControlArray} from './forms/model';
|
||||||
|
|
||||||
|
@ -12,10 +12,7 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {isPresent} from '../../../src/facade/lang';
|
import {isPresent} from '../../../src/facade/lang';
|
||||||
import {ListWrapper} from '../../../src/facade/collection';
|
import {ListWrapper} from '../../../src/facade/collection';
|
||||||
import {
|
import {NG_VALUE_ACCESSOR, ControlValueAccessor} from './control_value_accessor';
|
||||||
NG_VALUE_ACCESSOR,
|
|
||||||
ControlValueAccessor
|
|
||||||
} from './control_value_accessor';
|
|
||||||
import {NgControl} from './ng_control';
|
import {NgControl} from './ng_control';
|
||||||
|
|
||||||
export const RADIO_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
|
export const RADIO_VALUE_ACCESSOR: any = /*@ts2dart_const*/ /*@ts2dart_Provider*/ {
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
import {
|
import {Pipe, Injectable, ChangeDetectorRef, OnDestroy, WrappedValue} from '@angular/core';
|
||||||
Pipe,
|
|
||||||
Injectable,
|
|
||||||
ChangeDetectorRef,
|
|
||||||
OnDestroy,
|
|
||||||
WrappedValue
|
|
||||||
} from '@angular/core';
|
|
||||||
|
|
||||||
import {isBlank, isPresent, isPromise} from '../../src/facade/lang';
|
import {isBlank, isPresent, isPromise} from '../../src/facade/lang';
|
||||||
import {ObservableWrapper, Observable, EventEmitter} from '../../src/facade/async';
|
import {ObservableWrapper, Observable, EventEmitter} from '../../src/facade/async';
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
import {Injectable, PipeTransform, Pipe} from '@angular/core';
|
import {Injectable, PipeTransform, Pipe} from '@angular/core';
|
||||||
import {
|
import {isStringMap, StringWrapper, isPresent, RegExpWrapper} from '../../src/facade/lang';
|
||||||
isStringMap,
|
|
||||||
StringWrapper,
|
|
||||||
isPresent,
|
|
||||||
RegExpWrapper
|
|
||||||
} from '../../src/facade/lang';
|
|
||||||
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
import {InvalidPipeArgumentException} from './invalid_pipe_argument_exception';
|
||||||
|
|
||||||
var interpolationExp: RegExp = RegExpWrapper.create('#');
|
var interpolationExp: RegExp = RegExpWrapper.create('#');
|
||||||
|
@ -10,7 +10,7 @@ import {
|
|||||||
it,
|
it,
|
||||||
xit,
|
xit,
|
||||||
} from '@angular/core/testing/testing_internal';
|
} 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 {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
import {ListWrapper, StringMapWrapper, SetWrapper} from '../../src/facade/collection';
|
import {ListWrapper, StringMapWrapper, SetWrapper} from '../../src/facade/collection';
|
||||||
import {Component, provide} from '@angular/core';
|
import {Component, provide} from '@angular/core';
|
||||||
|
@ -28,7 +28,8 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
async.done();
|
async.done();
|
||||||
@ -44,7 +45,8 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello2');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello2');
|
||||||
async.done();
|
async.done();
|
||||||
@ -60,19 +62,22 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.debugElement.componentInstance.booleanCondition = false;
|
fixture.debugElement.componentInstance.booleanCondition = false;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.booleanCondition = true;
|
fixture.debugElement.componentInstance.booleanCondition = true;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.booleanCondition = false;
|
fixture.debugElement.componentInstance.booleanCondition = false;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
|
|
||||||
@ -90,31 +95,36 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.debugElement.componentInstance.booleanCondition = false;
|
fixture.debugElement.componentInstance.booleanCondition = false;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.booleanCondition = true;
|
fixture.debugElement.componentInstance.booleanCondition = true;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.nestedBooleanCondition = false;
|
fixture.debugElement.componentInstance.nestedBooleanCondition = false;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.nestedBooleanCondition = true;
|
fixture.debugElement.componentInstance.nestedBooleanCondition = true;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.booleanCondition = false;
|
fixture.debugElement.componentInstance.booleanCondition = false;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
|
|
||||||
@ -135,21 +145,24 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(3);
|
.toEqual(3);
|
||||||
expect(getDOM().getText(fixture.debugElement.nativeElement))
|
expect(getDOM().getText(fixture.debugElement.nativeElement))
|
||||||
.toEqual('helloNumberhelloStringhelloFunction');
|
.toEqual('helloNumberhelloStringhelloFunction');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.numberCondition = 0;
|
fixture.debugElement.componentInstance.numberCondition = 0;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('helloString');
|
expect(fixture.debugElement.nativeElement).toHaveText('helloString');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.numberCondition = 1;
|
fixture.debugElement.componentInstance.numberCondition = 1;
|
||||||
fixture.debugElement.componentInstance.stringCondition = "bar";
|
fixture.debugElement.componentInstance.stringCondition = "bar";
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('helloNumber');
|
expect(fixture.debugElement.nativeElement).toHaveText('helloNumber');
|
||||||
async.done();
|
async.done();
|
||||||
@ -166,13 +179,17 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(getDOM()
|
||||||
|
.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me')
|
||||||
|
.length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.numberCondition = 2;
|
fixture.debugElement.componentInstance.numberCondition = 2;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(getDOM()
|
||||||
|
.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me')
|
||||||
|
.length)
|
||||||
.toEqual(1);
|
.toEqual(1);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
expect(fixture.debugElement.nativeElement).toHaveText('hello');
|
||||||
|
|
||||||
@ -188,14 +205,14 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
getDOM().addClass(getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'),
|
getDOM().addClass(
|
||||||
"foo");
|
getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'), "foo");
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.numberCondition = 2;
|
fixture.debugElement.componentInstance.numberCondition = 2;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(
|
expect(getDOM().hasClass(
|
||||||
getDOM().hasClass(getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'),
|
getDOM().querySelector(fixture.debugElement.nativeElement, 'copy-me'),
|
||||||
"foo"))
|
"foo"))
|
||||||
.toBe(true);
|
.toBe(true);
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -212,7 +229,9 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
expect(() => fixture.detectChanges()).toThrowError();
|
expect(() => fixture.detectChanges()).toThrowError();
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'copy-me').length)
|
expect(getDOM()
|
||||||
|
.querySelectorAll(fixture.debugElement.nativeElement, 'copy-me')
|
||||||
|
.length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('');
|
expect(fixture.debugElement.nativeElement).toHaveText('');
|
||||||
async.done();
|
async.done();
|
||||||
|
@ -31,7 +31,8 @@ export function main() {
|
|||||||
.createAsync(TestComponent)
|
.createAsync(TestComponent)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('40px');
|
.toEqual('40px');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -49,13 +50,15 @@ export function main() {
|
|||||||
|
|
||||||
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('40px');
|
.toEqual('40px');
|
||||||
|
|
||||||
expr = fixture.debugElement.componentInstance.expr;
|
expr = fixture.debugElement.componentInstance.expr;
|
||||||
expr['max-width'] = '30%';
|
expr['max-width'] = '30%';
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('30%');
|
.toEqual('30%');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -71,12 +74,14 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('40px');
|
.toEqual('40px');
|
||||||
|
|
||||||
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
|
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('');
|
.toEqual('');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -92,16 +97,20 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('40px');
|
.toEqual('40px');
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
||||||
.toEqual('12px');
|
.toEqual('12px');
|
||||||
|
|
||||||
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
|
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('');
|
.toEqual('');
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
||||||
.toEqual('12px');
|
.toEqual('12px');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -117,17 +126,21 @@ export function main() {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
fixture.debugElement.componentInstance.expr = {'max-width': '40px'};
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('40px');
|
.toEqual('40px');
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'font-size'))
|
||||||
.toEqual('12px');
|
.toEqual('12px');
|
||||||
|
|
||||||
StringMapWrapper.delete(fixture.debugElement.componentInstance.expr, 'max-width');
|
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');
|
.toEqual('12px');
|
||||||
|
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
expect(
|
||||||
|
getDOM().getStyle(fixture.debugElement.children[0].nativeElement, 'max-width'))
|
||||||
.toEqual('');
|
.toEqual('');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -9,12 +9,7 @@ import {
|
|||||||
afterEach,
|
afterEach,
|
||||||
inject,
|
inject,
|
||||||
} from '@angular/core/testing/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
import {
|
import {fakeAsync, flushMicrotasks, Log, tick} from '@angular/core/testing';
|
||||||
fakeAsync,
|
|
||||||
flushMicrotasks,
|
|
||||||
Log,
|
|
||||||
tick
|
|
||||||
} from '@angular/core/testing';
|
|
||||||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
import {ControlGroup, Control, ControlArray, Validators} from '@angular/common';
|
import {ControlGroup, Control, ControlArray, Validators} from '@angular/common';
|
||||||
import {IS_DART, isPresent} from '../../src/facade/lang';
|
import {IS_DART, isPresent} from '../../src/facade/lang';
|
||||||
|
@ -8,12 +8,7 @@ import {
|
|||||||
beforeEach,
|
beforeEach,
|
||||||
afterEach
|
afterEach
|
||||||
} from '@angular/core/testing/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
import {
|
import {fakeAsync, flushMicrotasks, Log, tick} from '@angular/core/testing';
|
||||||
fakeAsync,
|
|
||||||
flushMicrotasks,
|
|
||||||
Log,
|
|
||||||
tick
|
|
||||||
} from '@angular/core/testing';
|
|
||||||
import {ControlGroup, Control, Validators, AbstractControl, ControlArray} from '@angular/common';
|
import {ControlGroup, Control, Validators, AbstractControl, ControlArray} from '@angular/common';
|
||||||
import {PromiseWrapper} from '../../src/facade/promise';
|
import {PromiseWrapper} from '../../src/facade/promise';
|
||||||
import {EventEmitter, ObservableWrapper, TimerWrapper} from '../../src/facade/async';
|
import {EventEmitter, ObservableWrapper, TimerWrapper} from '../../src/facade/async';
|
||||||
|
@ -10,6 +10,4 @@ export class SpyChangeDetectorRef extends SpyObject {
|
|||||||
|
|
||||||
export class SpyNgControl extends SpyObject {}
|
export class SpyNgControl extends SpyObject {}
|
||||||
|
|
||||||
export class SpyValueAccessor extends SpyObject {
|
export class SpyValueAccessor extends SpyObject { writeValue: any; }
|
||||||
writeValue: any;
|
|
||||||
}
|
|
||||||
|
@ -1,16 +1,19 @@
|
|||||||
import {__core_private__ as r, __core_private_types__ as t} from '@angular/core';
|
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 type ChangeDetectorState = t.ChangeDetectorState;
|
||||||
export var ChangeDetectorState: typeof t.ChangeDetectorState = r.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 var constructDependencies: typeof t.constructDependencies = r.constructDependencies;
|
||||||
export type LifecycleHooks = t.LifecycleHooks;
|
export type LifecycleHooks = t.LifecycleHooks;
|
||||||
export var LifecycleHooks: typeof t.LifecycleHooks = r.LifecycleHooks;
|
export var LifecycleHooks: typeof t.LifecycleHooks = r.LifecycleHooks;
|
||||||
export var LIFECYCLE_HOOKS_VALUES: typeof t.LIFECYCLE_HOOKS_VALUES = r.LIFECYCLE_HOOKS_VALUES;
|
export var LIFECYCLE_HOOKS_VALUES: typeof t.LIFECYCLE_HOOKS_VALUES = r.LIFECYCLE_HOOKS_VALUES;
|
||||||
export type ReflectorReader = t.ReflectorReader;
|
export type ReflectorReader = t.ReflectorReader;
|
||||||
export var ReflectorReader: typeof t.ReflectorReader = r.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 type AppElement = t.AppElement;
|
||||||
export var AppElement: typeof t.AppElement = r.AppElement;
|
export var AppElement: typeof t.AppElement = r.AppElement;
|
||||||
export var AppView: typeof t.AppView = r.AppView;
|
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 ViewType: typeof t.ViewType = r.ViewType;
|
||||||
export var MAX_INTERPOLATION_VALUES: typeof t.MAX_INTERPOLATION_VALUES = r.MAX_INTERPOLATION_VALUES;
|
export var MAX_INTERPOLATION_VALUES: typeof t.MAX_INTERPOLATION_VALUES = r.MAX_INTERPOLATION_VALUES;
|
||||||
export var checkBinding: typeof t.checkBinding = r.checkBinding;
|
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 interpolate: typeof t.interpolate = r.interpolate;
|
||||||
export var ViewUtils: typeof t.ViewUtils = r.ViewUtils;
|
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 DebugContext: typeof t.DebugContext = r.DebugContext;
|
||||||
export var StaticNodeDebugInfo: typeof t.StaticNodeDebugInfo = r.StaticNodeDebugInfo;
|
export var StaticNodeDebugInfo: typeof t.StaticNodeDebugInfo = r.StaticNodeDebugInfo;
|
||||||
export var devModeEqual: typeof t.devModeEqual = r.devModeEqual;
|
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 var castByValue: typeof t.castByValue = r.castByValue;
|
||||||
export type Console = t.Console;
|
export type Console = t.Console;
|
||||||
export var Console: typeof t.Console = r.Console;
|
export var Console: typeof t.Console = r.Console;
|
||||||
|
|
||||||
|
@ -316,7 +316,9 @@ export class CompileTokenMetadata implements CompileMetadataWithIdentifier {
|
|||||||
(isPresent(ak) && ak == token2.assetCacheKey);
|
(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> {
|
export class CompileTokenMap<VALUE> {
|
||||||
|
@ -12,7 +12,7 @@ import {
|
|||||||
ContentChildMetadata,
|
ContentChildMetadata,
|
||||||
ViewChildMetadata,
|
ViewChildMetadata,
|
||||||
reflector
|
reflector
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {ReflectorReader} from '../core_private';
|
import {ReflectorReader} from '../core_private';
|
||||||
|
|
||||||
import {Type, isPresent, stringify} from '../src/facade/lang';
|
import {Type, isPresent, stringify} from '../src/facade/lang';
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
import {
|
import {StringWrapper, NumberWrapper, isPresent, isBlank, serializeEnum} from '../src/facade/lang';
|
||||||
StringWrapper,
|
|
||||||
NumberWrapper,
|
|
||||||
isPresent,
|
|
||||||
isBlank,
|
|
||||||
serializeEnum
|
|
||||||
} from '../src/facade/lang';
|
|
||||||
import {ListWrapper} from '../src/facade/collection';
|
import {ListWrapper} from '../src/facade/collection';
|
||||||
import {ParseLocation, ParseError, ParseSourceFile, ParseSourceSpan} from './parse_util';
|
import {ParseLocation, ParseError, ParseSourceFile, ParseSourceSpan} from './parse_util';
|
||||||
import {getHtmlTagDefinition, HtmlTagContentType, NAMED_ENTITIES} from './html_tags';
|
import {getHtmlTagDefinition, HtmlTagContentType, NAMED_ENTITIES} from './html_tags';
|
||||||
|
@ -84,20 +84,14 @@ var impEMPTY_ARRAY = EMPTY_ARRAY;
|
|||||||
var impEMPTY_MAP = EMPTY_MAP;
|
var impEMPTY_MAP = EMPTY_MAP;
|
||||||
|
|
||||||
export class Identifiers {
|
export class Identifiers {
|
||||||
static ViewUtils = new CompileIdentifierMetadata({
|
static ViewUtils = new CompileIdentifierMetadata(
|
||||||
name: 'ViewUtils',
|
{name: 'ViewUtils', moduleUrl: assetUrl('core', 'linker/view_utils'), runtime: impViewUtils});
|
||||||
moduleUrl: assetUrl('core', 'linker/view_utils'),
|
|
||||||
runtime: impViewUtils
|
|
||||||
});
|
|
||||||
static AppView = new CompileIdentifierMetadata(
|
static AppView = new CompileIdentifierMetadata(
|
||||||
{name: 'AppView', moduleUrl: APP_VIEW_MODULE_URL, runtime: impAppView});
|
{name: 'AppView', moduleUrl: APP_VIEW_MODULE_URL, runtime: impAppView});
|
||||||
static DebugAppView = new CompileIdentifierMetadata(
|
static DebugAppView = new CompileIdentifierMetadata(
|
||||||
{name: 'DebugAppView', moduleUrl: APP_VIEW_MODULE_URL, runtime: impDebugAppView});
|
{name: 'DebugAppView', moduleUrl: APP_VIEW_MODULE_URL, runtime: impDebugAppView});
|
||||||
static AppElement = new CompileIdentifierMetadata({
|
static AppElement = new CompileIdentifierMetadata(
|
||||||
name: 'AppElement',
|
{name: 'AppElement', moduleUrl: assetUrl('core', 'linker/element'), runtime: impAppElement});
|
||||||
moduleUrl: assetUrl('core', 'linker/element'),
|
|
||||||
runtime: impAppElement
|
|
||||||
});
|
|
||||||
static ElementRef = new CompileIdentifierMetadata({
|
static ElementRef = new CompileIdentifierMetadata({
|
||||||
name: 'ElementRef',
|
name: 'ElementRef',
|
||||||
moduleUrl: assetUrl('core', 'linker/element_ref'),
|
moduleUrl: assetUrl('core', 'linker/element_ref'),
|
||||||
@ -118,11 +112,8 @@ export class Identifiers {
|
|||||||
moduleUrl: assetUrl('core', 'render/api'),
|
moduleUrl: assetUrl('core', 'render/api'),
|
||||||
runtime: impRenderComponentType
|
runtime: impRenderComponentType
|
||||||
});
|
});
|
||||||
static QueryList = new CompileIdentifierMetadata({
|
static QueryList = new CompileIdentifierMetadata(
|
||||||
name: 'QueryList',
|
{name: 'QueryList', moduleUrl: assetUrl('core', 'linker/query_list'), runtime: impQueryList});
|
||||||
moduleUrl: assetUrl('core', 'linker/query_list'),
|
|
||||||
runtime: impQueryList
|
|
||||||
});
|
|
||||||
static TemplateRef = new CompileIdentifierMetadata({
|
static TemplateRef = new CompileIdentifierMetadata({
|
||||||
name: 'TemplateRef',
|
name: 'TemplateRef',
|
||||||
moduleUrl: assetUrl('core', 'linker/template_ref'),
|
moduleUrl: assetUrl('core', 'linker/template_ref'),
|
||||||
@ -135,21 +126,15 @@ export class Identifiers {
|
|||||||
});
|
});
|
||||||
static ValueUnwrapper = new CompileIdentifierMetadata(
|
static ValueUnwrapper = new CompileIdentifierMetadata(
|
||||||
{name: 'ValueUnwrapper', moduleUrl: CD_MODULE_URL, runtime: impValueUnwrapper});
|
{name: 'ValueUnwrapper', moduleUrl: CD_MODULE_URL, runtime: impValueUnwrapper});
|
||||||
static Injector = new CompileIdentifierMetadata({
|
static Injector = new CompileIdentifierMetadata(
|
||||||
name: 'Injector',
|
{name: 'Injector', moduleUrl: assetUrl('core', 'di/injector'), runtime: impInjector});
|
||||||
moduleUrl: assetUrl('core', 'di/injector'),
|
|
||||||
runtime: impInjector
|
|
||||||
});
|
|
||||||
static ViewEncapsulation = new CompileIdentifierMetadata({
|
static ViewEncapsulation = new CompileIdentifierMetadata({
|
||||||
name: 'ViewEncapsulation',
|
name: 'ViewEncapsulation',
|
||||||
moduleUrl: assetUrl('core', 'metadata/view'),
|
moduleUrl: assetUrl('core', 'metadata/view'),
|
||||||
runtime: impViewEncapsulation
|
runtime: impViewEncapsulation
|
||||||
});
|
});
|
||||||
static ViewType = new CompileIdentifierMetadata({
|
static ViewType = new CompileIdentifierMetadata(
|
||||||
name: 'ViewType',
|
{name: 'ViewType', moduleUrl: assetUrl('core', 'linker/view_type'), runtime: impViewType});
|
||||||
moduleUrl: assetUrl('core', 'linker/view_type'),
|
|
||||||
runtime: impViewType
|
|
||||||
});
|
|
||||||
static ChangeDetectionStrategy = new CompileIdentifierMetadata({
|
static ChangeDetectionStrategy = new CompileIdentifierMetadata({
|
||||||
name: 'ChangeDetectionStrategy',
|
name: 'ChangeDetectionStrategy',
|
||||||
moduleUrl: CD_MODULE_URL,
|
moduleUrl: CD_MODULE_URL,
|
||||||
@ -165,11 +150,8 @@ export class Identifiers {
|
|||||||
moduleUrl: assetUrl('core', 'linker/debug_context'),
|
moduleUrl: assetUrl('core', 'linker/debug_context'),
|
||||||
runtime: impDebugContext
|
runtime: impDebugContext
|
||||||
});
|
});
|
||||||
static Renderer = new CompileIdentifierMetadata({
|
static Renderer = new CompileIdentifierMetadata(
|
||||||
name: 'Renderer',
|
{name: 'Renderer', moduleUrl: assetUrl('core', 'render/api'), runtime: impRenderer});
|
||||||
moduleUrl: assetUrl('core', 'render/api'),
|
|
||||||
runtime: impRenderer
|
|
||||||
});
|
|
||||||
static SimpleChange = new CompileIdentifierMetadata(
|
static SimpleChange = new CompileIdentifierMetadata(
|
||||||
{name: 'SimpleChange', moduleUrl: CD_MODULE_URL, runtime: impSimpleChange});
|
{name: 'SimpleChange', moduleUrl: CD_MODULE_URL, runtime: impSimpleChange});
|
||||||
static uninitialized = new CompileIdentifierMetadata(
|
static uninitialized = new CompileIdentifierMetadata(
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
import {Injectable, Provider, provide} from '@angular/core';
|
import {Injectable, Provider, provide} from '@angular/core';
|
||||||
|
|
||||||
import {
|
import {StringWrapper, RegExpWrapper, isBlank, isPresent} from '../src/facade/lang';
|
||||||
StringWrapper,
|
|
||||||
RegExpWrapper,
|
|
||||||
isBlank,
|
|
||||||
isPresent
|
|
||||||
} from '../src/facade/lang';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
HtmlAstVisitor,
|
HtmlAstVisitor,
|
||||||
|
@ -7,9 +7,12 @@ import {
|
|||||||
HostMetadata,
|
HostMetadata,
|
||||||
SkipSelfMetadata,
|
SkipSelfMetadata,
|
||||||
Provider,
|
Provider,
|
||||||
PLATFORM_DIRECTIVES, PLATFORM_PIPES,
|
PLATFORM_DIRECTIVES,
|
||||||
|
PLATFORM_PIPES,
|
||||||
reflector,
|
reflector,
|
||||||
Injectable, Inject, Optional,
|
Injectable,
|
||||||
|
Inject,
|
||||||
|
Optional,
|
||||||
ViewMetadata,
|
ViewMetadata,
|
||||||
NoAnnotationError,
|
NoAnnotationError,
|
||||||
QueryMetadata,
|
QueryMetadata,
|
||||||
@ -17,10 +20,7 @@ import {
|
|||||||
InjectMetadata,
|
InjectMetadata,
|
||||||
ViewQueryMetadata
|
ViewQueryMetadata
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {
|
import {constructDependencies, LIFECYCLE_HOOKS_VALUES, ReflectorReader} from '../core_private';
|
||||||
constructDependencies,
|
|
||||||
LIFECYCLE_HOOKS_VALUES, ReflectorReader
|
|
||||||
} from '../core_private';
|
|
||||||
import {
|
import {
|
||||||
Type,
|
Type,
|
||||||
isBlank,
|
isBlank,
|
||||||
@ -413,7 +413,7 @@ function calcTemplateBaseUrl(reflector: ReflectorReader, type: any,
|
|||||||
var moduleId = cmpMetadata.moduleId;
|
var moduleId = cmpMetadata.moduleId;
|
||||||
var scheme = getUrlScheme(moduleId);
|
var scheme = getUrlScheme(moduleId);
|
||||||
return isPresent(scheme) && scheme.length > 0 ? moduleId :
|
return isPresent(scheme) && scheme.length > 0 ? moduleId :
|
||||||
`package:${moduleId}${MODULE_SUFFIX}`;
|
`package:${moduleId}${MODULE_SUFFIX}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return reflector.importUri(type);
|
return reflector.importUri(type);
|
||||||
|
@ -17,7 +17,8 @@ import {OutputEmitter} from './output/abstract_emitter';
|
|||||||
import * as o from './output/output_ast';
|
import * as o from './output/output_ast';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
MODULE_SUFFIX, assetUrl,
|
MODULE_SUFFIX,
|
||||||
|
assetUrl,
|
||||||
} from './util';
|
} from './util';
|
||||||
|
|
||||||
var _COMPONENT_FACTORY_IDENTIFIER = new CompileIdentifierMetadata({
|
var _COMPONENT_FACTORY_IDENTIFIER = new CompileIdentifierMetadata({
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
import {
|
import {isPresent, isBlank, isString, StringWrapper} from '../../src/facade/lang';
|
||||||
isPresent,
|
|
||||||
isBlank,
|
|
||||||
isString,
|
|
||||||
StringWrapper
|
|
||||||
} from '../../src/facade/lang';
|
|
||||||
import {BaseException} from '../../src/facade/exceptions';
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
import * as o from './output_ast';
|
import * as o from './output_ast';
|
||||||
|
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
import {
|
import {isPresent, isBlank, isArray} from '../../src/facade/lang';
|
||||||
isPresent,
|
|
||||||
isBlank,
|
|
||||||
isArray
|
|
||||||
} from '../../src/facade/lang';
|
|
||||||
import {BaseException} from '../../src/facade/exceptions';
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
import {CompileIdentifierMetadata} from '../compile_metadata';
|
import {CompileIdentifierMetadata} from '../compile_metadata';
|
||||||
import * as o from './output_ast';
|
import * as o from './output_ast';
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
import {reflector} from '@angular/core';
|
import {reflector} from '@angular/core';
|
||||||
import {
|
import {isPresent, IS_DART, FunctionWrapper} from '../../src/facade/lang';
|
||||||
isPresent,
|
|
||||||
IS_DART,
|
|
||||||
FunctionWrapper
|
|
||||||
} from '../../src/facade/lang';
|
|
||||||
import {ObservableWrapper} from '../../src/facade/async';
|
import {ObservableWrapper} from '../../src/facade/async';
|
||||||
import {BaseException, unimplemented} from '../../src/facade/exceptions';
|
import {BaseException, unimplemented} from '../../src/facade/exceptions';
|
||||||
import {ListWrapper} from '../../src/facade/collection';
|
import {ListWrapper} from '../../src/facade/collection';
|
||||||
|
@ -1,9 +1,5 @@
|
|||||||
import * as o from './output_ast';
|
import * as o from './output_ast';
|
||||||
import {
|
import {isPresent, isBlank, isArray} from '../../src/facade/lang';
|
||||||
isPresent,
|
|
||||||
isBlank,
|
|
||||||
isArray
|
|
||||||
} from '../../src/facade/lang';
|
|
||||||
import {BaseException} from '../../src/facade/exceptions';
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
import {CompileIdentifierMetadata} from '../compile_metadata';
|
import {CompileIdentifierMetadata} from '../compile_metadata';
|
||||||
import {
|
import {
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import {resolveForwardRef, Injectable, PipeMetadata, reflector} from '@angular/core';
|
import {resolveForwardRef, Injectable, PipeMetadata, reflector} from '@angular/core';
|
||||||
|
|
||||||
import {
|
import {ReflectorReader} from '../core_private';
|
||||||
ReflectorReader
|
|
||||||
} from '../core_private';
|
|
||||||
|
|
||||||
import {Type, isPresent, stringify} from '../src/facade/lang';
|
import {Type, isPresent, stringify} from '../src/facade/lang';
|
||||||
import {BaseException} from '../src/facade/exceptions';
|
import {BaseException} from '../src/facade/exceptions';
|
||||||
|
@ -5,7 +5,8 @@ import {
|
|||||||
AttrAst,
|
AttrAst,
|
||||||
DirectiveAst,
|
DirectiveAst,
|
||||||
ProviderAst,
|
ProviderAst,
|
||||||
ProviderAstType, ReferenceAst
|
ProviderAstType,
|
||||||
|
ReferenceAst
|
||||||
} from './template_ast';
|
} from './template_ast';
|
||||||
import {
|
import {
|
||||||
CompileTypeMetadata,
|
CompileTypeMetadata,
|
||||||
|
@ -50,153 +50,153 @@ const OBJECT = 'object';
|
|||||||
* NOTE: This schema is auto extracted from `schema_extractor.ts` located in the test folder.
|
* NOTE: This schema is auto extracted from `schema_extractor.ts` located in the test folder.
|
||||||
*/
|
*/
|
||||||
const SCHEMA: string[] =
|
const SCHEMA: string[] =
|
||||||
/*@ts2dart_const*/ ([
|
/*@ts2dart_const*/ ([
|
||||||
'*|%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop',
|
'*|%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',
|
'^*|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',
|
'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:^*|*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:graphics^@svg:|',
|
||||||
'@svg:animation^@svg:|*begin,*end,*repeat',
|
'@svg:animation^@svg:|*begin,*end,*repeat',
|
||||||
'@svg:geometry^@svg:|',
|
'@svg:geometry^@svg:|',
|
||||||
'@svg:componentTransferFunction^@svg:|',
|
'@svg:componentTransferFunction^@svg:|',
|
||||||
'@svg:gradient^@svg:|',
|
'@svg:gradient^@svg:|',
|
||||||
'@svg:textContent^@svg:graphics|',
|
'@svg:textContent^@svg:graphics|',
|
||||||
'@svg:textPositioning^@svg:textContent|',
|
'@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',
|
'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',
|
'area|alt,coords,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,search,shape,target,username',
|
||||||
'audio^media|',
|
'audio^media|',
|
||||||
'br|clear',
|
'br|clear',
|
||||||
'base|href,target',
|
'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',
|
'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',
|
'button|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',
|
||||||
'canvas|#height,#width',
|
'canvas|#height,#width',
|
||||||
'content|select',
|
'content|select',
|
||||||
'dl|!compact',
|
'dl|!compact',
|
||||||
'datalist|',
|
'datalist|',
|
||||||
'details|!open',
|
'details|!open',
|
||||||
'dialog|!open,returnValue',
|
'dialog|!open,returnValue',
|
||||||
'dir|!compact',
|
'dir|!compact',
|
||||||
'div|align',
|
'div|align',
|
||||||
'embed|align,height,name,src,type,width',
|
'embed|align,height,name,src,type,width',
|
||||||
'fieldset|!disabled,name',
|
'fieldset|!disabled,name',
|
||||||
'font|color,face,size',
|
'font|color,face,size',
|
||||||
'form|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',
|
'form|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',
|
||||||
'frame|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src',
|
'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',
|
'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',
|
'hr|align,color,!noShade,size,width',
|
||||||
'head|',
|
'head|',
|
||||||
'h1,h2,h3,h4,h5,h6|align',
|
'h1,h2,h3,h4,h5,h6|align',
|
||||||
'html|version',
|
'html|version',
|
||||||
'iframe|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,%sandbox,scrolling,src,srcdoc,width',
|
'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',
|
'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',
|
'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',
|
'keygen|!autofocus,challenge,!disabled,keytype,name',
|
||||||
'li|type,#value',
|
'li|type,#value',
|
||||||
'label|htmlFor',
|
'label|htmlFor',
|
||||||
'legend|align',
|
'legend|align',
|
||||||
'link|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type',
|
'link|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,rel,%relList,rev,%sizes,target,type',
|
||||||
'map|name',
|
'map|name',
|
||||||
'marquee|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',
|
'marquee|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',
|
||||||
'menu|!compact',
|
'menu|!compact',
|
||||||
'meta|content,httpEquiv,name,scheme',
|
'meta|content,httpEquiv,name,scheme',
|
||||||
'meter|#high,#low,#max,#min,#optimum,#value',
|
'meter|#high,#low,#max,#min,#optimum,#value',
|
||||||
'ins,del|cite,dateTime',
|
'ins,del|cite,dateTime',
|
||||||
'ol|!compact,!reversed,#start,type',
|
'ol|!compact,!reversed,#start,type',
|
||||||
'object|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',
|
'object|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width',
|
||||||
'optgroup|!disabled,label',
|
'optgroup|!disabled,label',
|
||||||
'option|!defaultSelected,!disabled,label,!selected,text,value',
|
'option|!defaultSelected,!disabled,label,!selected,text,value',
|
||||||
'output|defaultValue,%htmlFor,name,value',
|
'output|defaultValue,%htmlFor,name,value',
|
||||||
'p|align',
|
'p|align',
|
||||||
'param|name,type,value,valueType',
|
'param|name,type,value,valueType',
|
||||||
'picture|',
|
'picture|',
|
||||||
'pre|#width',
|
'pre|#width',
|
||||||
'progress|#max,#value',
|
'progress|#max,#value',
|
||||||
'q,blockquote,cite|',
|
'q,blockquote,cite|',
|
||||||
'script|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',
|
'script|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',
|
||||||
'select|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',
|
'select|!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',
|
||||||
'shadow|',
|
'shadow|',
|
||||||
'source|media,sizes,src,srcset,type',
|
'source|media,sizes,src,srcset,type',
|
||||||
'span|',
|
'span|',
|
||||||
'style|!disabled,media,type',
|
'style|!disabled,media,type',
|
||||||
'caption|align',
|
'caption|align',
|
||||||
'th,td|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',
|
'th,td|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width',
|
||||||
'col,colgroup|align,ch,chOff,#span,vAlign,width',
|
'col,colgroup|align,ch,chOff,#span,vAlign,width',
|
||||||
'table|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',
|
'table|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width',
|
||||||
'tr|align,bgColor,ch,chOff,vAlign',
|
'tr|align,bgColor,ch,chOff,vAlign',
|
||||||
'tfoot,thead,tbody|align,ch,chOff,vAlign',
|
'tfoot,thead,tbody|align,ch,chOff,vAlign',
|
||||||
'template|',
|
'template|',
|
||||||
'textarea|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',
|
'textarea|autocapitalize,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',
|
||||||
'title|text',
|
'title|text',
|
||||||
'track|!default,kind,label,src,srclang',
|
'track|!default,kind,label,src,srclang',
|
||||||
'ul|!compact,type',
|
'ul|!compact,type',
|
||||||
'unknown|',
|
'unknown|',
|
||||||
'video^media|#height,poster,#width',
|
'video^media|#height,poster,#width',
|
||||||
'@svg:a^@svg:graphics|',
|
'@svg:a^@svg:graphics|',
|
||||||
'@svg:animate^@svg:animation|',
|
'@svg:animate^@svg:animation|',
|
||||||
'@svg:animateMotion^@svg:animation|',
|
'@svg:animateMotion^@svg:animation|',
|
||||||
'@svg:animateTransform^@svg:animation|',
|
'@svg:animateTransform^@svg:animation|',
|
||||||
'@svg:circle^@svg:geometry|',
|
'@svg:circle^@svg:geometry|',
|
||||||
'@svg:clipPath^@svg:graphics|',
|
'@svg:clipPath^@svg:graphics|',
|
||||||
'@svg:cursor^@svg:|',
|
'@svg:cursor^@svg:|',
|
||||||
'@svg:defs^@svg:graphics|',
|
'@svg:defs^@svg:graphics|',
|
||||||
'@svg:desc^@svg:|',
|
'@svg:desc^@svg:|',
|
||||||
'@svg:discard^@svg:|',
|
'@svg:discard^@svg:|',
|
||||||
'@svg:ellipse^@svg:geometry|',
|
'@svg:ellipse^@svg:geometry|',
|
||||||
'@svg:feBlend^@svg:|',
|
'@svg:feBlend^@svg:|',
|
||||||
'@svg:feColorMatrix^@svg:|',
|
'@svg:feColorMatrix^@svg:|',
|
||||||
'@svg:feComponentTransfer^@svg:|',
|
'@svg:feComponentTransfer^@svg:|',
|
||||||
'@svg:feComposite^@svg:|',
|
'@svg:feComposite^@svg:|',
|
||||||
'@svg:feConvolveMatrix^@svg:|',
|
'@svg:feConvolveMatrix^@svg:|',
|
||||||
'@svg:feDiffuseLighting^@svg:|',
|
'@svg:feDiffuseLighting^@svg:|',
|
||||||
'@svg:feDisplacementMap^@svg:|',
|
'@svg:feDisplacementMap^@svg:|',
|
||||||
'@svg:feDistantLight^@svg:|',
|
'@svg:feDistantLight^@svg:|',
|
||||||
'@svg:feDropShadow^@svg:|',
|
'@svg:feDropShadow^@svg:|',
|
||||||
'@svg:feFlood^@svg:|',
|
'@svg:feFlood^@svg:|',
|
||||||
'@svg:feFuncA^@svg:componentTransferFunction|',
|
'@svg:feFuncA^@svg:componentTransferFunction|',
|
||||||
'@svg:feFuncB^@svg:componentTransferFunction|',
|
'@svg:feFuncB^@svg:componentTransferFunction|',
|
||||||
'@svg:feFuncG^@svg:componentTransferFunction|',
|
'@svg:feFuncG^@svg:componentTransferFunction|',
|
||||||
'@svg:feFuncR^@svg:componentTransferFunction|',
|
'@svg:feFuncR^@svg:componentTransferFunction|',
|
||||||
'@svg:feGaussianBlur^@svg:|',
|
'@svg:feGaussianBlur^@svg:|',
|
||||||
'@svg:feImage^@svg:|',
|
'@svg:feImage^@svg:|',
|
||||||
'@svg:feMerge^@svg:|',
|
'@svg:feMerge^@svg:|',
|
||||||
'@svg:feMergeNode^@svg:|',
|
'@svg:feMergeNode^@svg:|',
|
||||||
'@svg:feMorphology^@svg:|',
|
'@svg:feMorphology^@svg:|',
|
||||||
'@svg:feOffset^@svg:|',
|
'@svg:feOffset^@svg:|',
|
||||||
'@svg:fePointLight^@svg:|',
|
'@svg:fePointLight^@svg:|',
|
||||||
'@svg:feSpecularLighting^@svg:|',
|
'@svg:feSpecularLighting^@svg:|',
|
||||||
'@svg:feSpotLight^@svg:|',
|
'@svg:feSpotLight^@svg:|',
|
||||||
'@svg:feTile^@svg:|',
|
'@svg:feTile^@svg:|',
|
||||||
'@svg:feTurbulence^@svg:|',
|
'@svg:feTurbulence^@svg:|',
|
||||||
'@svg:filter^@svg:|',
|
'@svg:filter^@svg:|',
|
||||||
'@svg:foreignObject^@svg:graphics|',
|
'@svg:foreignObject^@svg:graphics|',
|
||||||
'@svg:g^@svg:graphics|',
|
'@svg:g^@svg:graphics|',
|
||||||
'@svg:image^@svg:graphics|',
|
'@svg:image^@svg:graphics|',
|
||||||
'@svg:line^@svg:geometry|',
|
'@svg:line^@svg:geometry|',
|
||||||
'@svg:linearGradient^@svg:gradient|',
|
'@svg:linearGradient^@svg:gradient|',
|
||||||
'@svg:mpath^@svg:|',
|
'@svg:mpath^@svg:|',
|
||||||
'@svg:marker^@svg:|',
|
'@svg:marker^@svg:|',
|
||||||
'@svg:mask^@svg:|',
|
'@svg:mask^@svg:|',
|
||||||
'@svg:metadata^@svg:|',
|
'@svg:metadata^@svg:|',
|
||||||
'@svg:path^@svg:geometry|',
|
'@svg:path^@svg:geometry|',
|
||||||
'@svg:pattern^@svg:|',
|
'@svg:pattern^@svg:|',
|
||||||
'@svg:polygon^@svg:geometry|',
|
'@svg:polygon^@svg:geometry|',
|
||||||
'@svg:polyline^@svg:geometry|',
|
'@svg:polyline^@svg:geometry|',
|
||||||
'@svg:radialGradient^@svg:gradient|',
|
'@svg:radialGradient^@svg:gradient|',
|
||||||
'@svg:rect^@svg:geometry|',
|
'@svg:rect^@svg:geometry|',
|
||||||
'@svg:svg^@svg:graphics|#currentScale,#zoomAndPan',
|
'@svg:svg^@svg:graphics|#currentScale,#zoomAndPan',
|
||||||
'@svg:script^@svg:|type',
|
'@svg:script^@svg:|type',
|
||||||
'@svg:set^@svg:animation|',
|
'@svg:set^@svg:animation|',
|
||||||
'@svg:stop^@svg:|',
|
'@svg:stop^@svg:|',
|
||||||
'@svg:style^@svg:|!disabled,media,title,type',
|
'@svg:style^@svg:|!disabled,media,title,type',
|
||||||
'@svg:switch^@svg:graphics|',
|
'@svg:switch^@svg:graphics|',
|
||||||
'@svg:symbol^@svg:|',
|
'@svg:symbol^@svg:|',
|
||||||
'@svg:tspan^@svg:textPositioning|',
|
'@svg:tspan^@svg:textPositioning|',
|
||||||
'@svg:text^@svg:textPositioning|',
|
'@svg:text^@svg:textPositioning|',
|
||||||
'@svg:textPath^@svg:textContent|',
|
'@svg:textPath^@svg:textContent|',
|
||||||
'@svg:title^@svg:|',
|
'@svg:title^@svg:|',
|
||||||
'@svg:use^@svg:graphics|',
|
'@svg:use^@svg:graphics|',
|
||||||
'@svg:view^@svg:|#zoomAndPan'
|
'@svg:view^@svg:|#zoomAndPan'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
var attrToPropMap: {[name: string]: string} = <any>{
|
var attrToPropMap: {[name: string]: string} = <any>{
|
||||||
'class': 'className',
|
'class': 'className',
|
||||||
|
@ -2,4 +2,3 @@ export class ElementSchemaRegistry {
|
|||||||
hasProperty(tagName: string, propName: string): boolean { return true; }
|
hasProperty(tagName: string, propName: string): boolean { return true; }
|
||||||
getMappedPropName(propName: string): string { return propName; }
|
getMappedPropName(propName: string): string { return propName; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
import {ViewEncapsulation, Injectable} from '@angular/core';
|
import {ViewEncapsulation, Injectable} from '@angular/core';
|
||||||
import {
|
import {CompileIdentifierMetadata, CompileDirectiveMetadata} from './compile_metadata';
|
||||||
CompileIdentifierMetadata,
|
|
||||||
CompileDirectiveMetadata
|
|
||||||
} from './compile_metadata';
|
|
||||||
import * as o from './output/output_ast';
|
import * as o from './output/output_ast';
|
||||||
import {ShadowCss} from './shadow_css';
|
import {ShadowCss} from './shadow_css';
|
||||||
import {UrlResolver} from './url_resolver';
|
import {UrlResolver} from './url_resolver';
|
||||||
|
@ -70,7 +70,7 @@ export class ValueTransformer implements ValueVisitor {
|
|||||||
visitOther(value: any, context: any): any { return value; }
|
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 (IS_DART) {
|
||||||
if (path == null) {
|
if (path == null) {
|
||||||
return `asset:angular2/${pkg}/${pkg}.dart`;
|
return `asset:angular2/${pkg}/${pkg}.dart`;
|
||||||
|
@ -4,10 +4,7 @@ import {ListWrapper} from '../../src/facade/collection';
|
|||||||
import * as o from '../output/output_ast';
|
import * as o from '../output/output_ast';
|
||||||
import {Identifiers} from '../identifiers';
|
import {Identifiers} from '../identifiers';
|
||||||
|
|
||||||
import {
|
import {CompileQueryMetadata, CompileTokenMap} from '../compile_metadata';
|
||||||
CompileQueryMetadata,
|
|
||||||
CompileTokenMap
|
|
||||||
} from '../compile_metadata';
|
|
||||||
|
|
||||||
import {CompileView} from './compile_view';
|
import {CompileView} from './compile_view';
|
||||||
import {CompileElement} from './compile_element';
|
import {CompileElement} from './compile_element';
|
||||||
|
@ -20,7 +20,8 @@ import {
|
|||||||
getViewFactoryName,
|
getViewFactoryName,
|
||||||
injectFromViewParentInjector,
|
injectFromViewParentInjector,
|
||||||
createDiTokenExpression,
|
createDiTokenExpression,
|
||||||
getPropertyInView, createPureProxy
|
getPropertyInView,
|
||||||
|
createPureProxy
|
||||||
} from './util';
|
} from './util';
|
||||||
import {CompilerConfig} from '../config';
|
import {CompilerConfig} from '../config';
|
||||||
import {CompileBinding} from './compile_binding';
|
import {CompileBinding} from './compile_binding';
|
||||||
|
@ -5,9 +5,7 @@ import {
|
|||||||
reflector,
|
reflector,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import {
|
import {ReflectorReader} from '../core_private';
|
||||||
ReflectorReader
|
|
||||||
} from '../core_private';
|
|
||||||
|
|
||||||
import {Type, stringify, isBlank, isPresent} from '../src/facade/lang';
|
import {Type, stringify, isBlank, isPresent} from '../src/facade/lang';
|
||||||
import {BaseException} from '../src/facade/exceptions';
|
import {BaseException} from '../src/facade/exceptions';
|
||||||
|
@ -17,7 +17,7 @@ export function emit(): Promise<string> {
|
|||||||
// Generator
|
// Generator
|
||||||
export function main(args: string[]) {
|
export function main(args: string[]) {
|
||||||
emit().then((source) => {
|
emit().then((source) => {
|
||||||
// debug: console.error(source);
|
// debug: console.error(source);
|
||||||
print(source);
|
print(source);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ export function emit() {
|
|||||||
// Generator
|
// Generator
|
||||||
export function main(args: string[]) {
|
export function main(args: string[]) {
|
||||||
emit().then((source) => {
|
emit().then((source) => {
|
||||||
// debug: console.error(source);
|
// debug: console.error(source);
|
||||||
print(source);
|
print(source);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -15,8 +15,8 @@ export function getExpressions(): any {
|
|||||||
export function emit() {
|
export function emit() {
|
||||||
var emitter = IS_DART ? new DartEmitter() : new TypeScriptEmitter();
|
var emitter = IS_DART ? new DartEmitter() : new TypeScriptEmitter();
|
||||||
var emittedCode =
|
var emittedCode =
|
||||||
emitter.emitStatements(assetUrl('compiler', 'output/output_emitter_codegen_typed', 'test'),
|
emitter.emitStatements(assetUrl('compiler', 'output/output_emitter_codegen_typed', 'test'),
|
||||||
codegenStmts, codegenExportsVars);
|
codegenStmts, codegenExportsVars);
|
||||||
return emittedCode;
|
return emittedCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,12 +10,11 @@ export function getExpressions(): any {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generator
|
// Generator
|
||||||
export function emit () {
|
export function emit() {
|
||||||
var emitter = new JavaScriptEmitter();
|
var emitter = new JavaScriptEmitter();
|
||||||
var emittedCode =
|
var emittedCode =
|
||||||
emitter.emitStatements(
|
emitter.emitStatements(assetUrl('compiler', 'output/output_emitter_codegen_untyped', 'test'),
|
||||||
assetUrl('compiler', 'output/output_emitter_codegen_untyped', 'test'),
|
codegenStmts, codegenExportsVars);
|
||||||
codegenStmts, codegenExportsVars);
|
|
||||||
return emittedCode;
|
return emittedCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,9 +20,12 @@ import {EventEmitter} from '@angular/core';
|
|||||||
import {ViewType} from '@angular/core/src/linker/view_type';
|
import {ViewType} from '@angular/core/src/linker/view_type';
|
||||||
import {BaseException} from '@angular/core';
|
import {BaseException} from '@angular/core';
|
||||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
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 = [];
|
var outputDefs = [];
|
||||||
outputDefs.push({
|
outputDefs.push({
|
||||||
'getExpressions': () => interpretStatements(codegenStmts, 'getExpressions',
|
'getExpressions': () => interpretStatements(codegenStmts, 'getExpressions',
|
||||||
|
@ -19,11 +19,8 @@ var testDataIdentifier = new CompileIdentifierMetadata({
|
|||||||
runtime: ExternalClass
|
runtime: ExternalClass
|
||||||
});
|
});
|
||||||
|
|
||||||
var eventEmitterIdentifier = new CompileIdentifierMetadata({
|
var eventEmitterIdentifier = new CompileIdentifierMetadata(
|
||||||
name: 'EventEmitter',
|
{name: 'EventEmitter', moduleUrl: assetUrl('core'), runtime: EventEmitter});
|
||||||
moduleUrl: assetUrl('core'),
|
|
||||||
runtime: EventEmitter
|
|
||||||
});
|
|
||||||
|
|
||||||
var enumIdentifier = new CompileIdentifierMetadata({
|
var enumIdentifier = new CompileIdentifierMetadata({
|
||||||
name: 'ViewType.HOST',
|
name: 'ViewType.HOST',
|
||||||
@ -31,11 +28,8 @@ var enumIdentifier = new CompileIdentifierMetadata({
|
|||||||
runtime: ViewType.HOST
|
runtime: ViewType.HOST
|
||||||
});
|
});
|
||||||
|
|
||||||
var baseExceptionIdentifier = new CompileIdentifierMetadata({
|
var baseExceptionIdentifier = new CompileIdentifierMetadata(
|
||||||
name: 'BaseException',
|
{name: 'BaseException', moduleUrl: assetUrl('core'), runtime: BaseException});
|
||||||
moduleUrl: assetUrl('core'),
|
|
||||||
runtime: BaseException
|
|
||||||
});
|
|
||||||
|
|
||||||
export var codegenExportsVars = [
|
export var codegenExportsVars = [
|
||||||
'getExpressions',
|
'getExpressions',
|
||||||
|
@ -16,17 +16,27 @@ import {
|
|||||||
ComponentFixtureNoNgZone
|
ComponentFixtureNoNgZone
|
||||||
} from '@angular/compiler/testing';
|
} from '@angular/compiler/testing';
|
||||||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
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 {NgIf} from '@angular/common';
|
||||||
import {IS_DART} from '../src/facade/lang';
|
import {IS_DART} from '../src/facade/lang';
|
||||||
import {PromiseWrapper} from '../src/facade/promise';
|
import {PromiseWrapper} from '../src/facade/promise';
|
||||||
import {dispatchEvent} from "@angular/platform-browser/testing";
|
import {dispatchEvent} from "@angular/platform-browser/testing";
|
||||||
import {withProviders} from "@angular/core/testing/test_injector"
|
import {
|
||||||
|
withProviders
|
||||||
|
} from "@angular/core/testing/test_injector"
|
||||||
|
|
||||||
@Component(
|
@Component({
|
||||||
{selector: 'child-comp', template: `<span>Original {{childBinding}}</span>`, directives: []})
|
selector: 'child-comp',
|
||||||
@Injectable()
|
template: `<span>Original {{childBinding}}</span>`,
|
||||||
class ChildComp {
|
directives: []
|
||||||
|
}) @Injectable() class ChildComp {
|
||||||
childBinding: string;
|
childBinding: string;
|
||||||
constructor() { this.childBinding = 'Child'; }
|
constructor() { this.childBinding = 'Child'; }
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
import {NgZone, NgZoneError} from './zone/ng_zone';
|
import {NgZone, NgZoneError} from './zone/ng_zone';
|
||||||
import {
|
import {Type, isBlank, isPresent, assertionsEnabled, lockMode, isPromise} from '../src/facade/lang';
|
||||||
Type,
|
|
||||||
isBlank,
|
|
||||||
isPresent,
|
|
||||||
assertionsEnabled,
|
|
||||||
lockMode,
|
|
||||||
isPromise
|
|
||||||
} from '../src/facade/lang';
|
|
||||||
import {Injector, Injectable} from './di';
|
import {Injector, Injectable} from './di';
|
||||||
import {PLATFORM_INITIALIZER, APP_INITIALIZER} from './application_tokens';
|
import {PLATFORM_INITIALIZER, APP_INITIALIZER} from './application_tokens';
|
||||||
import {PromiseWrapper, ObservableWrapper} from '../src/facade/async';
|
import {PromiseWrapper, ObservableWrapper} from '../src/facade/async';
|
||||||
@ -14,11 +7,7 @@ import {ListWrapper} from '../src/facade/collection';
|
|||||||
import {TestabilityRegistry, Testability} from './testability/testability';
|
import {TestabilityRegistry, Testability} from './testability/testability';
|
||||||
import {ComponentResolver} from './linker/component_resolver';
|
import {ComponentResolver} from './linker/component_resolver';
|
||||||
import {ComponentRef, ComponentFactory} from './linker/component_factory';
|
import {ComponentRef, ComponentFactory} from './linker/component_factory';
|
||||||
import {
|
import {BaseException, ExceptionHandler, unimplemented} from '../src/facade/exceptions';
|
||||||
BaseException,
|
|
||||||
ExceptionHandler,
|
|
||||||
unimplemented
|
|
||||||
} from '../src/facade/exceptions';
|
|
||||||
import {Console} from './console';
|
import {Console} from './console';
|
||||||
import {wtfLeave, wtfCreateScope, WtfScopeFn} from './profile/profile';
|
import {wtfLeave, wtfCreateScope, WtfScopeFn} from './profile/profile';
|
||||||
import {ChangeDetectorRef} from './change_detection/change_detector_ref';
|
import {ChangeDetectorRef} from './change_detection/change_detector_ref';
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
import {looseIdentical, isPrimitive} from '../../src/facade/lang';
|
import {looseIdentical, isPrimitive} from '../../src/facade/lang';
|
||||||
import {
|
import {isListLikeIterable, areIterablesEqual} from '../../src/facade/collection';
|
||||||
isListLikeIterable,
|
|
||||||
areIterablesEqual
|
|
||||||
} from '../../src/facade/collection';
|
|
||||||
|
|
||||||
export {looseIdentical} from '../../src/facade/lang';
|
export {looseIdentical} from '../../src/facade/lang';
|
||||||
export var uninitialized: Object = /*@ts2dart_const*/ new Object();
|
export var uninitialized: Object = /*@ts2dart_const*/ new Object();
|
||||||
|
@ -1,10 +1,5 @@
|
|||||||
import {isPresent} from '../../src/facade/lang';
|
import {isPresent} from '../../src/facade/lang';
|
||||||
import {
|
import {Renderer, RootRenderer, RenderComponentType, RenderDebugInfo} from '../render/api';
|
||||||
Renderer,
|
|
||||||
RootRenderer,
|
|
||||||
RenderComponentType,
|
|
||||||
RenderDebugInfo
|
|
||||||
} from '../render/api';
|
|
||||||
import {
|
import {
|
||||||
DebugNode,
|
DebugNode,
|
||||||
DebugElement,
|
DebugElement,
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
import {
|
import {normalizeBool, Type, isType, isBlank, isFunction, stringify} from '../../src/facade/lang';
|
||||||
normalizeBool,
|
|
||||||
Type,
|
|
||||||
isType,
|
|
||||||
isBlank,
|
|
||||||
isFunction,
|
|
||||||
stringify
|
|
||||||
} from '../../src/facade/lang';
|
|
||||||
import {BaseException} from '../../src/facade/exceptions';
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
import {
|
import {isBlank, isPresent, looseIdentical} from '../../src/facade/lang';
|
||||||
isBlank,
|
|
||||||
isPresent,
|
|
||||||
looseIdentical
|
|
||||||
} from '../../src/facade/lang';
|
|
||||||
import {ListWrapper, StringMapWrapper} from '../../src/facade/collection';
|
import {ListWrapper, StringMapWrapper} from '../../src/facade/collection';
|
||||||
import {BaseException} from '../../src/facade/exceptions';
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
import {AppElement} from './element';
|
import {AppElement} from './element';
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
import {
|
import {Type, isPresent, isFunction, global, stringify, ConcreteType} from '../../src/facade/lang';
|
||||||
Type,
|
|
||||||
isPresent,
|
|
||||||
isFunction,
|
|
||||||
global,
|
|
||||||
stringify,
|
|
||||||
ConcreteType
|
|
||||||
} from '../../src/facade/lang';
|
|
||||||
import {BaseException} from '../../src/facade/exceptions';
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
import {GetterFn, SetterFn, MethodFn} from './types';
|
import {GetterFn, SetterFn, MethodFn} from './types';
|
||||||
import {PlatformReflectionCapabilities} from './platform_reflection_capabilities';
|
import {PlatformReflectionCapabilities} from './platform_reflection_capabilities';
|
||||||
|
@ -294,7 +294,8 @@ export function main() {
|
|||||||
var childTestEls = fixture.debugElement.queryAll(By.css('child-comp'));
|
var childTestEls = fixture.debugElement.queryAll(By.css('child-comp'));
|
||||||
|
|
||||||
expect(childTestEls.length).toBe(1);
|
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();
|
async.done();
|
||||||
});
|
});
|
||||||
|
@ -1,14 +1,4 @@
|
|||||||
import {
|
import {beforeEach, ddescribe, describe, expect, iit, inject, it, xdescribe, xit} from '../testing';
|
||||||
beforeEach,
|
|
||||||
ddescribe,
|
|
||||||
describe,
|
|
||||||
expect,
|
|
||||||
iit,
|
|
||||||
inject,
|
|
||||||
it,
|
|
||||||
xdescribe,
|
|
||||||
xit
|
|
||||||
} from '../testing';
|
|
||||||
|
|
||||||
import {assertionsEnabled, IS_DART} from '../../router/src/facade/lang';
|
import {assertionsEnabled, IS_DART} from '../../router/src/facade/lang';
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import {
|
|||||||
xdescribe,
|
xdescribe,
|
||||||
xit,
|
xit,
|
||||||
} from '@angular/core/testing/testing_internal';
|
} 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 {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
import {TestComponentBuilder} from '@angular/compiler/testing';
|
import {TestComponentBuilder} from '@angular/compiler/testing';
|
||||||
|
|
||||||
|
@ -23,4 +23,6 @@ export function main() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function identity(a) { return a; }
|
function identity(a) {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
@ -10,12 +10,7 @@ import {
|
|||||||
it,
|
it,
|
||||||
xit,
|
xit,
|
||||||
} from '@angular/core/testing/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
import {
|
import {containsRegexp, fakeAsync, tick, clearPendingTimers} from '@angular/core/testing';
|
||||||
containsRegexp,
|
|
||||||
fakeAsync,
|
|
||||||
tick,
|
|
||||||
clearPendingTimers
|
|
||||||
} from '@angular/core/testing';
|
|
||||||
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||||
@ -163,14 +158,14 @@ function declareTests(isJit: boolean) {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.debugElement.componentInstance.ctxProp = 'Initial aria label';
|
fixture.debugElement.componentInstance.ctxProp = 'Initial aria label';
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(
|
expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement,
|
||||||
getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'aria-label'))
|
'aria-label'))
|
||||||
.toEqual('Initial aria label');
|
.toEqual('Initial aria label');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.ctxProp = 'Changed aria label';
|
fixture.debugElement.componentInstance.ctxProp = 'Changed aria label';
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(
|
expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement,
|
||||||
getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'aria-label'))
|
'aria-label'))
|
||||||
.toEqual('Changed aria label');
|
.toEqual('Changed aria label');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -187,12 +182,14 @@ function declareTests(isJit: boolean) {
|
|||||||
|
|
||||||
fixture.debugElement.componentInstance.ctxProp = 'bar';
|
fixture.debugElement.componentInstance.ctxProp = 'bar';
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'foo'))
|
expect(
|
||||||
|
getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, 'foo'))
|
||||||
.toEqual('bar');
|
.toEqual('bar');
|
||||||
|
|
||||||
fixture.debugElement.componentInstance.ctxProp = null;
|
fixture.debugElement.componentInstance.ctxProp = null;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(getDOM().hasAttribute(fixture.debugElement.children[0].nativeElement, 'foo'))
|
expect(
|
||||||
|
getDOM().hasAttribute(fixture.debugElement.children[0].nativeElement, 'foo'))
|
||||||
.toBeFalsy();
|
.toBeFalsy();
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -1087,7 +1084,8 @@ function declareTests(isJit: boolean) {
|
|||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
|
|
||||||
expect(getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, "role"))
|
expect(
|
||||||
|
getDOM().getAttribute(fixture.debugElement.children[0].nativeElement, "role"))
|
||||||
.toEqual("button");
|
.toEqual("button");
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
@ -1136,9 +1134,9 @@ function declareTests(isJit: boolean) {
|
|||||||
var dispatchedEvent = getDOM().createMouseEvent('click');
|
var dispatchedEvent = getDOM().createMouseEvent('click');
|
||||||
var dispatchedEvent2 = getDOM().createMouseEvent('click');
|
var dispatchedEvent2 = getDOM().createMouseEvent('click');
|
||||||
getDOM().dispatchEvent(fixture.debugElement.children[0].nativeElement,
|
getDOM().dispatchEvent(fixture.debugElement.children[0].nativeElement,
|
||||||
dispatchedEvent);
|
dispatchedEvent);
|
||||||
getDOM().dispatchEvent(fixture.debugElement.children[1].nativeElement,
|
getDOM().dispatchEvent(fixture.debugElement.children[1].nativeElement,
|
||||||
dispatchedEvent2);
|
dispatchedEvent2);
|
||||||
expect(getDOM().isPrevented(dispatchedEvent)).toBe(true);
|
expect(getDOM().isPrevented(dispatchedEvent)).toBe(true);
|
||||||
expect(getDOM().isPrevented(dispatchedEvent2)).toBe(false);
|
expect(getDOM().isPrevented(dispatchedEvent2)).toBe(false);
|
||||||
expect(getDOM().getChecked(fixture.debugElement.children[0].nativeElement))
|
expect(getDOM().getChecked(fixture.debugElement.children[0].nativeElement))
|
||||||
@ -1379,7 +1377,8 @@ function declareTests(isJit: boolean) {
|
|||||||
}))
|
}))
|
||||||
.createAsync(MyComp)
|
.createAsync(MyComp)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
expect(getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'script').length)
|
expect(
|
||||||
|
getDOM().querySelectorAll(fixture.debugElement.nativeElement, 'script').length)
|
||||||
.toEqual(0);
|
.toEqual(0);
|
||||||
async.done();
|
async.done();
|
||||||
});
|
});
|
||||||
@ -2531,7 +2530,8 @@ class DuplicateDir {
|
|||||||
@Directive({selector: '[no-duplicate]'})
|
@Directive({selector: '[no-duplicate]'})
|
||||||
class OtherDuplicateDir {
|
class OtherDuplicateDir {
|
||||||
constructor(elRef: ElementRef) {
|
constructor(elRef: ElementRef) {
|
||||||
getDOM().setText(elRef.nativeElement, getDOM().getText(elRef.nativeElement) + 'othernoduplicate');
|
getDOM().setText(elRef.nativeElement,
|
||||||
|
getDOM().getText(elRef.nativeElement) + 'othernoduplicate');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,18 +269,18 @@ export function main() {
|
|||||||
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
|
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
|
||||||
var template = '<needs-tpl><template><div>light</div></template></needs-tpl>';
|
var template = '<needs-tpl><template><div>light</div></template></needs-tpl>';
|
||||||
tcb.overrideTemplate(MyComp0, template)
|
tcb.overrideTemplate(MyComp0, template)
|
||||||
.createAsync(MyComp0)
|
.createAsync(MyComp0)
|
||||||
.then((view) => {
|
.then((view) => {
|
||||||
view.detectChanges();
|
view.detectChanges();
|
||||||
var needsTpl: NeedsTpl = view.debugElement.children[0].inject(NeedsTpl);
|
var needsTpl: NeedsTpl = view.debugElement.children[0].inject(NeedsTpl);
|
||||||
|
|
||||||
expect(needsTpl.vc.createEmbeddedView(needsTpl.query.first).rootNodes[0])
|
expect(needsTpl.vc.createEmbeddedView(needsTpl.query.first).rootNodes[0])
|
||||||
.toHaveText('light');
|
.toHaveText('light');
|
||||||
expect(needsTpl.vc.createEmbeddedView(needsTpl.viewQuery.first).rootNodes[0])
|
expect(needsTpl.vc.createEmbeddedView(needsTpl.viewQuery.first).rootNodes[0])
|
||||||
.toHaveText('shadow');
|
.toHaveText('shadow');
|
||||||
|
|
||||||
async.done();
|
async.done();
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should find named TemplateRefs',
|
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]); }
|
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]'})
|
@Directive({selector: '[dir]'})
|
||||||
|
@ -10,13 +10,7 @@ import {
|
|||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
inject,
|
inject,
|
||||||
} from '@angular/core/testing/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
import {
|
import {fakeAsync, flushMicrotasks, Log, tick, containsRegexp} from '@angular/core/testing';
|
||||||
fakeAsync,
|
|
||||||
flushMicrotasks,
|
|
||||||
Log,
|
|
||||||
tick,
|
|
||||||
containsRegexp
|
|
||||||
} from '@angular/core/testing';
|
|
||||||
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
import {isBlank} from '../../src/facade/lang';
|
import {isBlank} from '../../src/facade/lang';
|
||||||
import {
|
import {
|
||||||
|
@ -19,9 +19,11 @@ import {
|
|||||||
HasGetterAndSetterDecorators
|
HasGetterAndSetterDecorators
|
||||||
} from './reflector_common';
|
} from './reflector_common';
|
||||||
import {IS_DART} from '../../src/facade/lang';
|
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;
|
value;
|
||||||
|
|
||||||
constructor(value) { this.value = value; }
|
constructor(value) { this.value = value; }
|
||||||
|
@ -1,13 +1,4 @@
|
|||||||
import {
|
import {describe, it, iit, ddescribe, expect, tick, beforeEach, containsRegexp} from '../testing';
|
||||||
describe,
|
|
||||||
it,
|
|
||||||
iit,
|
|
||||||
ddescribe,
|
|
||||||
expect,
|
|
||||||
tick,
|
|
||||||
beforeEach,
|
|
||||||
containsRegexp
|
|
||||||
} from '../testing';
|
|
||||||
import {SpyObject} from '@angular/core/testing/testing_internal';
|
import {SpyObject} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {MapWrapper} from '../../platform-browser/src/facade/collection';
|
import {MapWrapper} from '../../platform-browser/src/facade/collection';
|
||||||
|
@ -9,9 +9,7 @@ import {
|
|||||||
xdescribe,
|
xdescribe,
|
||||||
xit,
|
xit,
|
||||||
} from '@angular/core/testing/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
import {
|
import {Log} from '@angular/core/testing';
|
||||||
Log
|
|
||||||
} from '@angular/core/testing';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
PromiseCompleter,
|
PromiseCompleter,
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
ComponentFactory,
|
ComponentFactory,
|
||||||
Injector,
|
Injector,
|
||||||
NgZone,
|
NgZone,
|
||||||
Type
|
Type
|
||||||
} from '../index';
|
} from '../index';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import {RegExpWrapper, StringWrapper} from '../src/facade/lang';
|
import {RegExpWrapper, StringWrapper} from '../src/facade/lang';
|
||||||
|
|
||||||
var _RE_SPECIAL_CHARS =
|
var _RE_SPECIAL_CHARS =
|
||||||
['-', '[', ']', '/', '{', '}', '\\', '(', ')', '*', '+', '?', '.', '^', '$', '|'];
|
['-', '[', ']', '/', '{', '}', '\\', '(', ')', '*', '+', '?', '.', '^', '$', '|'];
|
||||||
var _ESCAPE_RE = RegExpWrapper.create(`[\\${_RE_SPECIAL_CHARS.join('\\')}]`);
|
var _ESCAPE_RE = RegExpWrapper.create(`[\\${_RE_SPECIAL_CHARS.join('\\')}]`);
|
||||||
export function containsRegexp(input: string): RegExp {
|
export function containsRegexp(input: string): RegExp {
|
||||||
return RegExpWrapper.create(
|
return RegExpWrapper.create(
|
||||||
StringWrapper.replaceAllMapped(input, _ESCAPE_RE, (match) => `\\${match[0]}`));
|
StringWrapper.replaceAllMapped(input, _ESCAPE_RE, (match) => `\\${match[0]}`));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,13 +2,7 @@
|
|||||||
* Public Test Library for unit testing Angular2 Applications. Uses the
|
* Public Test Library for unit testing Angular2 Applications. Uses the
|
||||||
* Jasmine framework.
|
* Jasmine framework.
|
||||||
*/
|
*/
|
||||||
import {
|
import {inject, async, injectAsync, TestInjector, getTestInjector} from './test_injector';
|
||||||
inject,
|
|
||||||
async,
|
|
||||||
injectAsync,
|
|
||||||
TestInjector,
|
|
||||||
getTestInjector
|
|
||||||
} from './test_injector';
|
|
||||||
|
|
||||||
import {isPromise} from '../src/facade/lang';
|
import {isPromise} from '../src/facade/lang';
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ class MyApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS));
|
var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS));
|
||||||
var appInjector =
|
var appInjector = ReflectiveInjector.resolveAndCreate([BROWSER_APP_STATIC_PROVIDERS, appProviders],
|
||||||
ReflectiveInjector.resolveAndCreate([BROWSER_APP_STATIC_PROVIDERS, appProviders], platform.injector);
|
platform.injector);
|
||||||
coreLoadAndBootstrap(appInjector, MyApp);
|
coreLoadAndBootstrap(appInjector, MyApp);
|
||||||
// #enddocregion
|
// #enddocregion
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
import {
|
import {isJsObject, global, isPresent, isBlank, isArray, getSymbolIterator} from './lang';
|
||||||
isJsObject,
|
|
||||||
global,
|
|
||||||
isPresent,
|
|
||||||
isBlank,
|
|
||||||
isArray,
|
|
||||||
getSymbolIterator
|
|
||||||
} from './lang';
|
|
||||||
|
|
||||||
export var Map = global.Map;
|
export var Map = global.Map;
|
||||||
export var Set = global.Set;
|
export var Set = global.Set;
|
||||||
|
@ -10,13 +10,7 @@ import {
|
|||||||
} from '@angular/core/testing/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
import {browserDetection} from '@angular/platform-browser/testing';
|
import {browserDetection} from '@angular/platform-browser/testing';
|
||||||
import {
|
import {ObservableWrapper, Observable, Subject, EventEmitter, PromiseWrapper} from '../src/async';
|
||||||
ObservableWrapper,
|
|
||||||
Observable,
|
|
||||||
Subject,
|
|
||||||
EventEmitter,
|
|
||||||
PromiseWrapper
|
|
||||||
} from '../src/async';
|
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('EventEmitter', () => {
|
describe('EventEmitter', () => {
|
||||||
|
@ -96,10 +96,7 @@ var COMMON: string[] = [
|
|||||||
'NgPluralCase'
|
'NgPluralCase'
|
||||||
];
|
];
|
||||||
|
|
||||||
var COMMON_TESTING: string[] = [
|
var COMMON_TESTING: string[] = ['MockLocationStrategy', 'SpyLocation'];
|
||||||
'MockLocationStrategy',
|
|
||||||
'SpyLocation'
|
|
||||||
];
|
|
||||||
|
|
||||||
var COMPILER: string[] = [
|
var COMPILER: string[] = [
|
||||||
'ElementSchemaRegistry',
|
'ElementSchemaRegistry',
|
||||||
@ -386,7 +383,7 @@ var PLATFORM_BROWSER: string[] = [
|
|||||||
var PLATFORM_BROWSER_TESTING: string[] = [
|
var PLATFORM_BROWSER_TESTING: string[] = [
|
||||||
'TEST_BROWSER_STATIC_APPLICATION_PROVIDERS',
|
'TEST_BROWSER_STATIC_APPLICATION_PROVIDERS',
|
||||||
'TEST_BROWSER_STATIC_PLATFORM_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',
|
'BrowserDetection',
|
||||||
'DOMTestComponentRenderer',
|
'DOMTestComponentRenderer',
|
||||||
'TestComponentRenderer',
|
'TestComponentRenderer',
|
||||||
@ -406,19 +403,13 @@ var PLATFORM_BROWSER_DYNAMIC: string[] = [
|
|||||||
'UrlChangeListener:dart'
|
'UrlChangeListener:dart'
|
||||||
];
|
];
|
||||||
|
|
||||||
var PLATFORM_BROWSER_DYNAMIC_TESTING: string[] = [
|
var PLATFORM_BROWSER_DYNAMIC_TESTING: string[] =
|
||||||
'TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS',
|
['TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS', 'TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS'];
|
||||||
'TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS'
|
|
||||||
];
|
|
||||||
|
|
||||||
var PLATFORM_SERVER: string[] = [
|
var PLATFORM_SERVER: string[] = ['Parse5DomAdapter'];
|
||||||
'Parse5DomAdapter'
|
|
||||||
];
|
|
||||||
|
|
||||||
var PLATFORM_SERVER_TESTING: string[] = [
|
var PLATFORM_SERVER_TESTING: string[] =
|
||||||
'TEST_SERVER_APPLICATION_PROVIDERS',
|
['TEST_SERVER_APPLICATION_PROVIDERS', 'TEST_SERVER_PLATFORM_PROVIDERS'];
|
||||||
'TEST_SERVER_PLATFORM_PROVIDERS'
|
|
||||||
];
|
|
||||||
|
|
||||||
var UPGRADE: string[] = [
|
var UPGRADE: string[] = [
|
||||||
'UpgradeAdapter',
|
'UpgradeAdapter',
|
||||||
@ -452,10 +443,7 @@ var HTTP: string[] = [
|
|||||||
'XHRConnection'
|
'XHRConnection'
|
||||||
];
|
];
|
||||||
|
|
||||||
var HTTP_TESTING: string[] = [
|
var HTTP_TESTING: string[] = ['MockBackend', 'MockConnection'];
|
||||||
'MockBackend',
|
|
||||||
'MockConnection'
|
|
||||||
];
|
|
||||||
|
|
||||||
var ROUTER: string[] = [
|
var ROUTER: string[] = [
|
||||||
'AsyncRoute',
|
'AsyncRoute',
|
||||||
@ -480,8 +468,7 @@ var ROUTER: string[] = [
|
|||||||
'RouterOutlet'
|
'RouterOutlet'
|
||||||
];
|
];
|
||||||
|
|
||||||
var ROUTER_TESTING: string[] = [
|
var ROUTER_TESTING: string[] = [];
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
var API = {
|
var API = {
|
||||||
|
@ -9,16 +9,17 @@ import {getDOM} from './platform_browser_private';
|
|||||||
import {ReflectionCapabilities} from './core_private';
|
import {ReflectionCapabilities} from './core_private';
|
||||||
|
|
||||||
export const CACHED_TEMPLATE_PROVIDER: Array<any /*Type | Provider | any[]*/> =
|
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.
|
* 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*/ [
|
export const BROWSER_APP_DYNAMIC_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
BROWSER_APP_COMMON_PROVIDERS,
|
/*@ts2dart_const*/[
|
||||||
COMPILER_PROVIDERS,
|
BROWSER_APP_COMMON_PROVIDERS,
|
||||||
{provide: XHR, useClass: XHRImpl},
|
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}.
|
* Returns a `Promise` of {@link ComponentRef}.
|
||||||
*/
|
*/
|
||||||
export function bootstrap(
|
export function bootstrap(
|
||||||
appComponentType: Type,
|
appComponentType: Type,
|
||||||
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
|
customProviders?: Array<any /*Type | Provider | any[]*/>): Promise<ComponentRef<any>> {
|
||||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||||
var appInjector = ReflectiveInjector.resolveAndCreate(
|
var appInjector = ReflectiveInjector.resolveAndCreate(
|
||||||
[BROWSER_APP_DYNAMIC_PROVIDERS, isPresent(customProviders) ? customProviders : []],
|
[BROWSER_APP_DYNAMIC_PROVIDERS, isPresent(customProviders) ? customProviders : []],
|
||||||
browserPlatform().injector);
|
browserPlatform().injector);
|
||||||
return coreLoadAndBootstrap(appInjector, appComponentType);
|
return coreLoadAndBootstrap(appInjector, appComponentType);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import {__platform_browser_private__ as _} from '@angular/platform-browser';
|
import {__platform_browser_private__ as _} from '@angular/platform-browser';
|
||||||
|
|
||||||
export type DomAdapter = _.DomAdapter;
|
export type DomAdapter = _.DomAdapter;
|
||||||
export function getDOM(): _.DomAdapter { return _.getDOM() };
|
export function getDOM(): _.DomAdapter{return _.getDOM()};
|
||||||
|
@ -9,10 +9,10 @@ import {BROWSER_APP_DYNAMIC_PROVIDERS} from '../index';
|
|||||||
* Default platform providers for testing.
|
* Default platform providers for testing.
|
||||||
*/
|
*/
|
||||||
export const TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
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.
|
* Default application providers for testing.
|
||||||
*/
|
*/
|
||||||
export const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
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];
|
||||||
|
@ -4,6 +4,7 @@ export type RenderDebugInfo = t.RenderDebugInfo;
|
|||||||
export var RenderDebugInfo: typeof t.RenderDebugInfo = r.RenderDebugInfo;
|
export var RenderDebugInfo: typeof t.RenderDebugInfo = r.RenderDebugInfo;
|
||||||
export var wtfInit: typeof t.wtfInit = r.wtfInit;
|
export var wtfInit: typeof t.wtfInit = r.wtfInit;
|
||||||
export var ReflectionCapabilities: typeof t.ReflectionCapabilities = r.ReflectionCapabilities;
|
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 type DebugDomRootRenderer = t.DebugDomRootRenderer;
|
||||||
export var DebugDomRootRenderer: typeof t.DebugDomRootRenderer = r.DebugDomRootRenderer;
|
export var DebugDomRootRenderer: typeof t.DebugDomRootRenderer = r.DebugDomRootRenderer;
|
||||||
|
@ -11,13 +11,9 @@ export namespace __platform_browser_private__ {
|
|||||||
export type DomAdapter = dom_adapter.DomAdapter;
|
export type DomAdapter = dom_adapter.DomAdapter;
|
||||||
export var DomAdapter = dom_adapter.DomAdapter;
|
export var DomAdapter = dom_adapter.DomAdapter;
|
||||||
|
|
||||||
export function getDOM():DomAdapter{
|
export function getDOM(): DomAdapter { return dom_adapter.getDOM(); }
|
||||||
return dom_adapter.getDOM();
|
|
||||||
}
|
|
||||||
|
|
||||||
export function setDOM(adapter:DomAdapter){
|
export function setDOM(adapter: DomAdapter) { return dom_adapter.setDOM(adapter); }
|
||||||
return dom_adapter.setDOM(adapter);
|
|
||||||
}
|
|
||||||
|
|
||||||
export var setRootDomAdapter = dom_adapter.setRootDomAdapter;
|
export var setRootDomAdapter = dom_adapter.setRootDomAdapter;
|
||||||
|
|
||||||
@ -27,7 +23,7 @@ export namespace __platform_browser_private__ {
|
|||||||
export type AnimationBuilder = animation_builder.AnimationBuilder;
|
export type AnimationBuilder = animation_builder.AnimationBuilder;
|
||||||
export var 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 var CssAnimationBuilder = css_animation_builder.CssAnimationBuilder;
|
||||||
|
|
||||||
export type CssAnimationOptions = css_animation_options.CssAnimationOptions;
|
export type CssAnimationOptions = css_animation_options.CssAnimationOptions;
|
||||||
|
@ -120,7 +120,8 @@ export class Animation {
|
|||||||
* @param classes
|
* @param classes
|
||||||
*/
|
*/
|
||||||
removeClasses(classes: string[]): void {
|
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 {
|
addEvents(): void {
|
||||||
if (this.totalTime > 0) {
|
if (this.totalTime > 0) {
|
||||||
this.eventClearFunctions.push(getDOM().onAndCancel(
|
this.eventClearFunctions.push(
|
||||||
this.element, getDOM().getTransitionEnd(), (event: any) => this.handleAnimationEvent(event)));
|
getDOM().onAndCancel(this.element, getDOM().getTransitionEnd(),
|
||||||
|
(event: any) => this.handleAnimationEvent(event)));
|
||||||
} else {
|
} else {
|
||||||
this.handleAnimationCompleted();
|
this.handleAnimationCompleted();
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,8 @@ export class BrowserDetails {
|
|||||||
*/
|
*/
|
||||||
doesElapsedTimeIncludesDelay(): void {
|
doesElapsedTimeIncludesDelay(): void {
|
||||||
var div = getDOM().createElement('div');
|
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;`);
|
height: 1px; transition: all 1ms linear 1ms;`);
|
||||||
// Firefox requires that we wait for 2 frames for some reason
|
// Firefox requires that we wait for 2 frames for some reason
|
||||||
this.raf((timestamp: any) => {
|
this.raf((timestamp: any) => {
|
||||||
|
@ -28,7 +28,7 @@ import {
|
|||||||
HAMMER_GESTURE_CONFIG,
|
HAMMER_GESTURE_CONFIG,
|
||||||
HammerGestureConfig,
|
HammerGestureConfig,
|
||||||
HammerGesturesPlugin
|
HammerGesturesPlugin
|
||||||
} from './dom/events/hammer_gestures'
|
} from './dom/events/hammer_gestures';
|
||||||
import {DomSharedStylesHost} from './dom/shared_styles_host';
|
import {DomSharedStylesHost} from './dom/shared_styles_host';
|
||||||
import {AnimationBuilder} from './animate/animation_builder';
|
import {AnimationBuilder} from './animate/animation_builder';
|
||||||
import {BrowserDetails} from './animate/browser_details';
|
import {BrowserDetails} from './animate/browser_details';
|
||||||
@ -97,7 +97,8 @@ export {
|
|||||||
} from '../src/dom/events/hammer_gestures'
|
} from '../src/dom/events/hammer_gestures'
|
||||||
|
|
||||||
|
|
||||||
export function initDomAdapter() {
|
export function
|
||||||
|
initDomAdapter() {
|
||||||
BrowserDomAdapter.makeCurrent();
|
BrowserDomAdapter.makeCurrent();
|
||||||
wtfInit();
|
wtfInit();
|
||||||
BrowserGetTestability.init();
|
BrowserGetTestability.init();
|
||||||
|
@ -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 {DebugDomRootRenderer} from '../../../core_private';
|
||||||
import {assertionsEnabled} from '../../facade/lang';
|
import {assertionsEnabled} from '../../facade/lang';
|
||||||
import {getDOM} from '../dom_adapter';
|
import {getDOM} from '../dom_adapter';
|
||||||
|
@ -2,11 +2,11 @@ import {isBlank, Type} from '../../src/facade/lang';
|
|||||||
|
|
||||||
var _DOM: DomAdapter = null;
|
var _DOM: DomAdapter = null;
|
||||||
|
|
||||||
export function getDOM(){
|
export function getDOM() {
|
||||||
return _DOM;
|
return _DOM;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setDOM(adapter:DomAdapter){
|
export function setDOM(adapter: DomAdapter) {
|
||||||
_DOM = adapter;
|
_DOM = adapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
RenderComponentType,
|
RenderComponentType,
|
||||||
ViewEncapsulation
|
ViewEncapsulation
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {RenderDebugInfo} from '../../core_private'
|
import {RenderDebugInfo} from '../../core_private';
|
||||||
import {AnimationBuilder} from '../animate/animation_builder';
|
import {AnimationBuilder} from '../animate/animation_builder';
|
||||||
import {
|
import {
|
||||||
isPresent,
|
isPresent,
|
||||||
@ -201,11 +201,12 @@ export class DomRenderer implements Renderer {
|
|||||||
var dashCasedPropertyName = camelCaseToDashCase(propertyName);
|
var dashCasedPropertyName = camelCaseToDashCase(propertyName);
|
||||||
if (getDOM().isCommentNode(renderElement)) {
|
if (getDOM().isCommentNode(renderElement)) {
|
||||||
var existingBindings = RegExpWrapper.firstMatch(
|
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]);
|
var parsedBindings = Json.parse(existingBindings[1]);
|
||||||
parsedBindings[dashCasedPropertyName] = propertyValue;
|
parsedBindings[dashCasedPropertyName] = propertyValue;
|
||||||
getDOM().setText(renderElement, StringWrapper.replace(TEMPLATE_COMMENT_TEXT, '{}',
|
getDOM().setText(renderElement, StringWrapper.replace(TEMPLATE_COMMENT_TEXT, '{}',
|
||||||
Json.stringify(parsedBindings)));
|
Json.stringify(parsedBindings)));
|
||||||
} else {
|
} else {
|
||||||
this.setElementAttribute(renderElement, propertyName, propertyValue);
|
this.setElementAttribute(renderElement, propertyName, propertyValue);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ export class KeyEventsPlugin extends EventManagerPlugin {
|
|||||||
|
|
||||||
return this.manager.getZone().runOutsideAngular(() => {
|
return this.manager.getZone().runOutsideAngular(() => {
|
||||||
return getDOM().onAndCancel(element, StringMapWrapper.get(parsedEvent, 'domEventName'),
|
return getDOM().onAndCancel(element, StringMapWrapper.get(parsedEvent, 'domEventName'),
|
||||||
outsideHandler);
|
outsideHandler);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,11 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
import {Type, isPresent, isBlank} from './facade/lang';
|
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 {ELEMENT_PROBE_PROVIDERS} from './dom/debug/ng_probe';
|
||||||
export {BrowserPlatformLocation} from './browser/location/browser_platform_location';
|
export {BrowserPlatformLocation} from './browser/location/browser_platform_location';
|
||||||
export {
|
export {
|
||||||
@ -45,8 +49,8 @@ export function bootstrapStatic(appComponentType: Type,
|
|||||||
initReflector();
|
initReflector();
|
||||||
}
|
}
|
||||||
|
|
||||||
let appProviders =
|
let appProviders = isPresent(customProviders) ? [BROWSER_APP_STATIC_PROVIDERS, customProviders] :
|
||||||
isPresent(customProviders) ? [BROWSER_APP_STATIC_PROVIDERS, customProviders] : BROWSER_APP_STATIC_PROVIDERS;
|
BROWSER_APP_STATIC_PROVIDERS;
|
||||||
var appInjector =
|
var appInjector =
|
||||||
ReflectiveInjector.resolveAndCreate(appProviders, browserStaticPlatform().injector);
|
ReflectiveInjector.resolveAndCreate(appProviders, browserStaticPlatform().injector);
|
||||||
return coreLoadAndBootstrap(appInjector, appComponentType);
|
return coreLoadAndBootstrap(appInjector, appComponentType);
|
||||||
|
@ -4,10 +4,7 @@ import {
|
|||||||
import {UrlChangeListener} from '@angular/common';
|
import {UrlChangeListener} from '@angular/common';
|
||||||
import {Injectable} from '@angular/core/src/di';
|
import {Injectable} from '@angular/core/src/di';
|
||||||
import {ROUTER_CHANNEL} from '../shared/messaging_api';
|
import {ROUTER_CHANNEL} from '../shared/messaging_api';
|
||||||
import {
|
import {ServiceMessageBrokerFactory, ServiceMessageBroker} from '../shared/service_message_broker';
|
||||||
ServiceMessageBrokerFactory,
|
|
||||||
ServiceMessageBroker
|
|
||||||
} from '../shared/service_message_broker';
|
|
||||||
import {PRIMITIVE, Serializer} from '../shared/serializer';
|
import {PRIMITIVE, Serializer} from '../shared/serializer';
|
||||||
import {bind} from './bind';
|
import {bind} from './bind';
|
||||||
import {LocationType} from '../shared/serialized_types';
|
import {LocationType} from '../shared/serialized_types';
|
||||||
|
@ -34,7 +34,9 @@ import {
|
|||||||
ClientMessageBrokerFactory,
|
ClientMessageBrokerFactory,
|
||||||
ClientMessageBrokerFactory_
|
ClientMessageBrokerFactory_
|
||||||
} from '../web_workers/shared/client_message_broker';
|
} 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 {Serializer} from '../web_workers/shared/serializer';
|
||||||
import {ON_WEB_WORKER} from '../web_workers/shared/api';
|
import {ON_WEB_WORKER} from '../web_workers/shared/api';
|
||||||
import {RenderStore} from '../web_workers/shared/render_store';
|
import {RenderStore} from '../web_workers/shared/render_store';
|
||||||
|
@ -12,10 +12,7 @@ import {
|
|||||||
assertPlatform
|
assertPlatform
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
|
||||||
export {
|
export {WORKER_APP_PLATFORM, WORKER_APP_APPLICATION_COMMON} from './webworker/worker_app_common';
|
||||||
WORKER_APP_PLATFORM,
|
|
||||||
WORKER_APP_APPLICATION_COMMON
|
|
||||||
} from './webworker/worker_app_common';
|
|
||||||
export {WORKER_APP_APPLICATION} from './webworker/worker_app';
|
export {WORKER_APP_APPLICATION} from './webworker/worker_app';
|
||||||
export {
|
export {
|
||||||
ClientMessageBroker,
|
ClientMessageBroker,
|
||||||
|
@ -216,9 +216,10 @@ export function main() {
|
|||||||
it('should unregister change detectors when components are disposed',
|
it('should unregister change detectors when components are disposed',
|
||||||
inject([AsyncTestCompleter], (async) => {
|
inject([AsyncTestCompleter], (async) => {
|
||||||
var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS));
|
var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS));
|
||||||
var app = ReflectiveInjector.resolveAndCreate([BROWSER_APP_DYNAMIC_PROVIDERS, testProviders],
|
var app =
|
||||||
platform.injector)
|
ReflectiveInjector.resolveAndCreate([BROWSER_APP_DYNAMIC_PROVIDERS, testProviders],
|
||||||
.get(ApplicationRef);
|
platform.injector)
|
||||||
|
.get(ApplicationRef);
|
||||||
coreLoadAndBootstrap(app.injector, HelloRootCmp)
|
coreLoadAndBootstrap(app.injector, HelloRootCmp)
|
||||||
.then((ref) => {
|
.then((ref) => {
|
||||||
ref.destroy();
|
ref.destroy();
|
||||||
|
@ -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 {NgZone} from '@angular/core/src/zone/ng_zone';
|
||||||
import {ListWrapper, Map} from '../../../src/facade/collection';
|
import {ListWrapper, Map} from '../../../src/facade/collection';
|
||||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
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';
|
import {el} from '../../../testing/browser_util';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
|
@ -66,7 +66,7 @@ export function main() {
|
|||||||
describe('test APIs for the browser', () => {
|
describe('test APIs for the browser', () => {
|
||||||
describe('angular2 jasmine matchers', () => {
|
describe('angular2 jasmine matchers', () => {
|
||||||
describe('toHaveCssClass', () => {
|
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');
|
var el = document.createElement('div');
|
||||||
el.classList.add('matias');
|
el.classList.add('matias');
|
||||||
expect(el).toHaveCssClass('matias');
|
expect(el).toHaveCssClass('matias');
|
||||||
|
@ -8,7 +8,9 @@ import {
|
|||||||
} from '@angular/core/testing/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
import {SpyMessageBroker} from './spies';
|
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 {LocationType} from '@angular/platform-browser/src/web_workers/shared/serialized_types';
|
||||||
import {MessageBus} from '@angular/platform-browser/src/web_workers/shared/message_bus';
|
import {MessageBus} from '@angular/platform-browser/src/web_workers/shared/message_bus';
|
||||||
import {
|
import {
|
||||||
|
@ -9,8 +9,8 @@ import {
|
|||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
} from '@angular/core/testing/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
import { TestInjector } from '@angular/core/testing';
|
import {TestInjector} from '@angular/core/testing';
|
||||||
import { TestComponentBuilder } from '@angular/compiler/testing';
|
import {TestComponentBuilder} from '@angular/compiler/testing';
|
||||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||||
import {
|
import {
|
||||||
bind,
|
bind,
|
||||||
@ -89,8 +89,7 @@ export function main() {
|
|||||||
uiRenderStore = new RenderStore();
|
uiRenderStore = new RenderStore();
|
||||||
var testUiInjector = new TestInjector();
|
var testUiInjector = new TestInjector();
|
||||||
testUiInjector.platformProviders = TEST_BROWSER_STATIC_PLATFORM_PROVIDERS;
|
testUiInjector.platformProviders = TEST_BROWSER_STATIC_PLATFORM_PROVIDERS;
|
||||||
testUiInjector.applicationProviders = TEST_BROWSER_STATIC_APPLICATION_PROVIDERS
|
testUiInjector.applicationProviders = TEST_BROWSER_STATIC_APPLICATION_PROVIDERS;
|
||||||
;
|
|
||||||
testUiInjector.addProviders([
|
testUiInjector.addProviders([
|
||||||
Serializer,
|
Serializer,
|
||||||
provide(RenderStore, {useValue: uiRenderStore}),
|
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',
|
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) => {
|
inject([TestComponentBuilder, AsyncTestCompleter], (tcb: TestComponentBuilder, async) => {
|
||||||
tcb.overrideView(MyComp2, new ViewMetadata(
|
tcb.overrideView(MyComp2, new ViewMetadata(
|
||||||
{template: '<input [title]="y" style="position:absolute">'}))
|
{template: '<input [title]="y" style="position:absolute">'}))
|
||||||
.createAsync(MyComp2)
|
.createAsync(MyComp2)
|
||||||
.then((fixture) => {
|
.then((fixture) => {
|
||||||
var checkSetters = (componentRef, workerEl) => {
|
var checkSetters = (componentRef, workerEl) => {
|
||||||
@ -225,7 +224,8 @@ export function main() {
|
|||||||
getRenderer(fixture.componentRef)
|
getRenderer(fixture.componentRef)
|
||||||
.invokeElementMethod(el.nativeElement, 'setAttribute', ['a', 'b']);
|
.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();
|
async.done();
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
@ -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';
|
import {SpyObject, proxy} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import { Animation } from '../src/animate/animation';
|
import {Animation} from '../src/animate/animation';
|
||||||
import { CssAnimationOptions } from '../src/animate/css_animation_options';
|
import {CssAnimationOptions} from '../src/animate/css_animation_options';
|
||||||
import { BrowserDetails } from '../src/animate/browser_details';
|
import {BrowserDetails} from '../src/animate/browser_details';
|
||||||
import { AnimationBuilder } from '../src/animate/animation_builder';
|
import {AnimationBuilder} from '../src/animate/animation_builder';
|
||||||
import { CssAnimationBuilder } from '../src/animate/css_animation_builder';
|
import {CssAnimationBuilder} from '../src/animate/css_animation_builder';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class MockAnimationBuilder extends AnimationBuilder {
|
export class MockAnimationBuilder extends AnimationBuilder {
|
||||||
|
@ -61,7 +61,4 @@ export const ADDITIONAL_TEST_BROWSER_PROVIDERS: Array<any /*Type | Provider | an
|
|||||||
* Default application providers for testing without a compiler.
|
* Default application providers for testing without a compiler.
|
||||||
*/
|
*/
|
||||||
export const TEST_BROWSER_STATIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
export const TEST_BROWSER_STATIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||||
/*@ts2dart_const*/[
|
/*@ts2dart_const*/[BROWSER_APP_COMMON_PROVIDERS, ADDITIONAL_TEST_BROWSER_PROVIDERS];
|
||||||
BROWSER_APP_COMMON_PROVIDERS,
|
|
||||||
ADDITIONAL_TEST_BROWSER_PROVIDERS
|
|
||||||
];
|
|
||||||
|
@ -4,7 +4,7 @@ import {isPresent, isString, RegExpWrapper, StringWrapper, RegExp} from '../src/
|
|||||||
|
|
||||||
export class BrowserDetection {
|
export class BrowserDetection {
|
||||||
private _overrideUa: string;
|
private _overrideUa: string;
|
||||||
private get _ua():string {
|
private get _ua(): string {
|
||||||
if (isPresent(this._overrideUa)) {
|
if (isPresent(this._overrideUa)) {
|
||||||
return this._overrideUa;
|
return this._overrideUa;
|
||||||
} else {
|
} else {
|
||||||
@ -14,9 +14,7 @@ export class BrowserDetection {
|
|||||||
|
|
||||||
static setup() { browserDetection = new BrowserDetection(null); }
|
static setup() { browserDetection = new BrowserDetection(null); }
|
||||||
|
|
||||||
constructor(ua: string) {
|
constructor(ua: string) { this._overrideUa = ua; }
|
||||||
this._overrideUa = ua;
|
|
||||||
}
|
|
||||||
|
|
||||||
get isFirefox(): boolean { return this._ua.indexOf('Firefox') > -1; }
|
get isFirefox(): boolean { return this._ua.indexOf('Firefox') > -1; }
|
||||||
|
|
||||||
|
@ -5,4 +5,3 @@ export var SelectorMatcher: typeof _.SelectorMatcher = _.SelectorMatcher;
|
|||||||
|
|
||||||
export type CssSelector = typeof _.CssSelector;
|
export type CssSelector = typeof _.CssSelector;
|
||||||
export var CssSelector: typeof _.CssSelector = _.CssSelector;
|
export var CssSelector: typeof _.CssSelector = _.CssSelector;
|
||||||
|
|
||||||
|
@ -2,14 +2,7 @@ var parse5 = require('parse5/index');
|
|||||||
|
|
||||||
import {ListWrapper, StringMapWrapper} from '../src/facade/collection';
|
import {ListWrapper, StringMapWrapper} from '../src/facade/collection';
|
||||||
import {DomAdapter, setRootDomAdapter} from '../platform_browser_private';
|
import {DomAdapter, setRootDomAdapter} from '../platform_browser_private';
|
||||||
import {
|
import {isPresent, isBlank, global, Type, setValueOnPath, DateWrapper} from '../src/facade/lang';
|
||||||
isPresent,
|
|
||||||
isBlank,
|
|
||||||
global,
|
|
||||||
Type,
|
|
||||||
setValueOnPath,
|
|
||||||
DateWrapper
|
|
||||||
} from '../src/facade/lang';
|
|
||||||
import {BaseException} from '../src/facade/exceptions';
|
import {BaseException} from '../src/facade/exceptions';
|
||||||
import {SelectorMatcher, CssSelector} from '../compiler_private';
|
import {SelectorMatcher, CssSelector} from '../compiler_private';
|
||||||
import {XHR} from '@angular/compiler';
|
import {XHR} from '@angular/compiler';
|
||||||
|
@ -23,7 +23,10 @@ import {DOCUMENT} from '@angular/platform-browser';
|
|||||||
import {getDOM} from '../platform_browser_private';
|
import {getDOM} from '../platform_browser_private';
|
||||||
import {RootRenderer} from '@angular/core';
|
import {RootRenderer} from '@angular/core';
|
||||||
import {DomRootRenderer, DomRootRenderer_} from '../../platform-browser/src/dom/dom_renderer';
|
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 {
|
import {
|
||||||
EventManager,
|
EventManager,
|
||||||
EVENT_MANAGER_PLUGINS,
|
EVENT_MANAGER_PLUGINS,
|
||||||
|
@ -40,7 +40,7 @@ import {MockLocationStrategy} from '@angular/common/testing';
|
|||||||
import {ApplicationRef} from '@angular/core/src/application_ref';
|
import {ApplicationRef} from '@angular/core/src/application_ref';
|
||||||
import {MockApplicationRef} from '@angular/core/testing';
|
import {MockApplicationRef} from '@angular/core/testing';
|
||||||
|
|
||||||
//noinspection JSAnnotator
|
// noinspection JSAnnotator
|
||||||
class DummyConsole implements Console {
|
class DummyConsole implements Console {
|
||||||
log(message) {}
|
log(message) {}
|
||||||
warn(message) {}
|
warn(message) {}
|
||||||
|
@ -197,15 +197,15 @@ export function main() {
|
|||||||
// adapter
|
// adapter
|
||||||
// can't handle css child selectors.
|
// can't handle css child selectors.
|
||||||
expect(getDOM().getAttribute(fixture.debugElement.query(By.css('book-cmp'))
|
expect(getDOM().getAttribute(fixture.debugElement.query(By.css('book-cmp'))
|
||||||
.query(By.css('a'))
|
.query(By.css('a'))
|
||||||
.nativeElement,
|
.nativeElement,
|
||||||
'href'))
|
'href'))
|
||||||
.toEqual('/book/1984/page/100');
|
.toEqual('/book/1984/page/100');
|
||||||
|
|
||||||
expect(getDOM().getAttribute(fixture.debugElement.query(By.css('page-cmp'))
|
expect(getDOM().getAttribute(fixture.debugElement.query(By.css('page-cmp'))
|
||||||
.query(By.css('a'))
|
.query(By.css('a'))
|
||||||
.nativeElement,
|
.nativeElement,
|
||||||
'href'))
|
'href'))
|
||||||
.toEqual('/book/1984/page/2');
|
.toEqual('/book/1984/page/2');
|
||||||
async.done();
|
async.done();
|
||||||
});
|
});
|
||||||
|
@ -34,8 +34,9 @@ export class RootCmp {
|
|||||||
activatedCmp: any;
|
activatedCmp: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function compile(tcb: TestComponentBuilder,
|
export function compile(
|
||||||
template: string = "<router-outlet></router-outlet>"): Promise<ComponentFixture<RootCmp>> {
|
tcb: TestComponentBuilder,
|
||||||
|
template: string = "<router-outlet></router-outlet>"): Promise<ComponentFixture<RootCmp>> {
|
||||||
return tcb.overrideTemplate(RootCmp, ('<div>' + template + '</div>')).createAsync(RootCmp);
|
return tcb.overrideTemplate(RootCmp, ('<div>' + template + '</div>')).createAsync(RootCmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ export class UpgradeAdapter {
|
|||||||
(injector: angular.IInjectorService, rootScope: angular.IRootScopeService) => {
|
(injector: angular.IInjectorService, rootScope: angular.IRootScopeService) => {
|
||||||
ng1Injector = injector;
|
ng1Injector = injector;
|
||||||
ngZone.onMicrotaskEmpty.subscribe(
|
ngZone.onMicrotaskEmpty.subscribe(
|
||||||
{next: (_) => ngZone.runOutsideAngular(() => rootScope.$apply())});
|
{next: (_) => ngZone.runOutsideAngular(() => rootScope.$apply())});
|
||||||
UpgradeNg1ComponentAdapterBuilder.resolve(this.downgradedComponents, injector)
|
UpgradeNg1ComponentAdapterBuilder.resolve(this.downgradedComponents, injector)
|
||||||
.then(resolve, reject);
|
.then(resolve, reject);
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,12 @@ import {OnInit, provide, ReflectiveInjector, ComponentResolver} from '@angular/c
|
|||||||
import {RouterOutlet} from './directives/router_outlet';
|
import {RouterOutlet} from './directives/router_outlet';
|
||||||
import {Type, isBlank, isPresent} from '@angular/facade/src/lang';
|
import {Type, isBlank, isPresent} from '@angular/facade/src/lang';
|
||||||
import {ListWrapper} from '@angular/facade/src/collection';
|
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 {StringMapWrapper} from '@angular/facade/src/collection';
|
||||||
import {BaseException} from '@angular/core';
|
import {BaseException} from '@angular/core';
|
||||||
import {RouterUrlSerializer} from './router_url_serializer';
|
import {RouterUrlSerializer} from './router_url_serializer';
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
import {ROUTER_PROVIDERS_COMMON} from './router_providers_common';
|
import {ROUTER_PROVIDERS_COMMON} from './router_providers_common';
|
||||||
import {
|
import {BrowserPlatformLocation} from '@angular/platform-browser';
|
||||||
BrowserPlatformLocation
|
|
||||||
} from '@angular/platform-browser';
|
|
||||||
import {PlatformLocation} from '@angular/common';
|
import {PlatformLocation} from '@angular/common';
|
||||||
|
|
||||||
export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[
|
export const ROUTER_PROVIDERS: any[] = /*@ts2dart_const*/[
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
import {PromiseWrapper} from '@angular/facade';
|
import {PromiseWrapper} from '@angular/facade';
|
||||||
import {Component} from '@angular/core';
|
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";
|
const ECHO_CHANNEL = "ECHO";
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
import {Provider} from '@angular/core';
|
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 {HashLocationStrategy, LocationStrategy} from '@angular/common';
|
||||||
import {App} from './index_common';
|
import {App} from './index_common';
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user