chore(facade): remove most facade/async functions
This commit is contained in:

committed by
Alex Rickabaugh

parent
6baf3baedd
commit
99989f5d3f
@ -6,18 +6,16 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, iit, inject, it, xit,} from '@angular/core/testing/testing_internal';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
import {ComponentFixture, TestComponentBuilder} from '@angular/core/testing';
|
||||
|
||||
import {Location} from '@angular/common';
|
||||
import {ComponentFixture, TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
import {AsyncRoute, Route, Router} from '@angular/router-deprecated';
|
||||
|
||||
import {specs, compile, TEST_ROUTER_PROVIDERS, clickOnElement, getHref} from '../util';
|
||||
|
||||
import {Router, AsyncRoute, Route} from '@angular/router-deprecated';
|
||||
|
||||
import {HelloCmp, helloCmpLoader, UserCmp, userCmpLoader, TeamCmp, asyncTeamLoader, ParentCmp, parentCmpLoader, asyncParentCmpLoader, asyncDefaultParentCmpLoader, ParentWithDefaultCmp, parentWithDefaultCmpLoader, asyncRouteDataCmp} from './fixture_components';
|
||||
import {By} from '../../../../platform-browser/src/dom/debug/by';
|
||||
import {TEST_ROUTER_PROVIDERS, clickOnElement, compile, getHref, specs} from '../util';
|
||||
|
||||
import {HelloCmp, ParentCmp, ParentWithDefaultCmp, TeamCmp, UserCmp, asyncDefaultParentCmpLoader, asyncParentCmpLoader, asyncRouteDataCmp, asyncTeamLoader, helloCmpLoader, parentCmpLoader, parentWithDefaultCmpLoader, userCmpLoader} from './fixture_components';
|
||||
|
||||
function getLinkElement(rtc: ComponentFixture<any>) {
|
||||
return rtc.debugElement.query(By.css('a')).nativeElement;
|
||||
|
@ -9,8 +9,6 @@
|
||||
import {Component, ComponentRef, ViewChild, ViewContainerRef} from '@angular/core';
|
||||
import {DynamicComponentLoader} from '@angular/core/src/linker/dynamic_component_loader';
|
||||
import {AsyncRoute, ROUTER_DIRECTIVES, Redirect, Route, RouteConfig, RouteData, RouteParams} from '@angular/router-deprecated';
|
||||
|
||||
import {PromiseWrapper} from '../../../src/facade/async';
|
||||
import {isPresent} from '../../../src/facade/lang';
|
||||
|
||||
@Component({selector: 'goodbye-cmp', template: `{{farewell}}`})
|
||||
@ -26,7 +24,7 @@ export class HelloCmp {
|
||||
}
|
||||
|
||||
export function helloCmpLoader() {
|
||||
return PromiseWrapper.resolve(HelloCmp);
|
||||
return Promise.resolve(HelloCmp);
|
||||
}
|
||||
|
||||
|
||||
@ -37,7 +35,7 @@ export class UserCmp {
|
||||
}
|
||||
|
||||
export function userCmpLoader() {
|
||||
return PromiseWrapper.resolve(UserCmp);
|
||||
return Promise.resolve(UserCmp);
|
||||
}
|
||||
|
||||
|
||||
@ -51,7 +49,7 @@ export class ParentCmp {
|
||||
}
|
||||
|
||||
export function parentCmpLoader() {
|
||||
return PromiseWrapper.resolve(ParentCmp);
|
||||
return Promise.resolve(ParentCmp);
|
||||
}
|
||||
|
||||
|
||||
@ -65,7 +63,7 @@ export class AsyncParentCmp {
|
||||
}
|
||||
|
||||
export function asyncParentCmpLoader() {
|
||||
return PromiseWrapper.resolve(AsyncParentCmp);
|
||||
return Promise.resolve(AsyncParentCmp);
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -79,7 +77,7 @@ export class AsyncDefaultParentCmp {
|
||||
}
|
||||
|
||||
export function asyncDefaultParentCmpLoader() {
|
||||
return PromiseWrapper.resolve(AsyncDefaultParentCmp);
|
||||
return Promise.resolve(AsyncDefaultParentCmp);
|
||||
}
|
||||
|
||||
|
||||
@ -93,7 +91,7 @@ export class ParentWithDefaultCmp {
|
||||
}
|
||||
|
||||
export function parentWithDefaultCmpLoader() {
|
||||
return PromiseWrapper.resolve(ParentWithDefaultCmp);
|
||||
return Promise.resolve(ParentWithDefaultCmp);
|
||||
}
|
||||
|
||||
|
||||
@ -120,7 +118,7 @@ export class AsyncTeamCmp {
|
||||
}
|
||||
|
||||
export function asyncTeamLoader() {
|
||||
return PromiseWrapper.resolve(AsyncTeamCmp);
|
||||
return Promise.resolve(AsyncTeamCmp);
|
||||
}
|
||||
|
||||
|
||||
@ -131,7 +129,7 @@ export class RouteDataCmp {
|
||||
}
|
||||
|
||||
export function asyncRouteDataCmp() {
|
||||
return PromiseWrapper.resolve(RouteDataCmp);
|
||||
return Promise.resolve(RouteDataCmp);
|
||||
}
|
||||
|
||||
@Component({selector: 'redirect-to-parent-cmp', template: 'redirect-to-parent'})
|
||||
|
@ -6,16 +6,15 @@
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, iit, inject, it, xit,} from '@angular/core/testing/testing_internal';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
import {ComponentFixture, TestComponentBuilder} from '@angular/core/testing';
|
||||
|
||||
import {specs, compile, TEST_ROUTER_PROVIDERS, clickOnElement, getHref} from '../util';
|
||||
import {Location} from '@angular/common';
|
||||
import {Router, Route} from '@angular/router-deprecated';
|
||||
import {HelloCmp, UserCmp, TeamCmp, ParentCmp, ParentWithDefaultCmp, DynamicLoaderCmp} from './fixture_components';
|
||||
import {PromiseWrapper} from '../../../src/facade/async';
|
||||
import {ComponentFixture, TestComponentBuilder} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, beforeEach, beforeEachProviders, iit, inject, it, xit} from '@angular/core/testing/testing_internal';
|
||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||
import {expect} from '@angular/platform-browser/testing/matchers';
|
||||
import {Route, Router} from '@angular/router-deprecated';
|
||||
import {TEST_ROUTER_PROVIDERS, clickOnElement, compile, getHref, specs} from '../util';
|
||||
|
||||
import {DynamicLoaderCmp, HelloCmp, ParentCmp, ParentWithDefaultCmp, TeamCmp, UserCmp} from './fixture_components';
|
||||
|
||||
|
||||
function getLinkElement(rtc: ComponentFixture<any>) {
|
||||
@ -497,7 +496,7 @@ function syncRoutesWithDynamicComponents() {
|
||||
// something
|
||||
// similar basically the assertion needs to run when the world is
|
||||
// stable and we don't know when that is, only zones know.
|
||||
PromiseWrapper.resolve(null).then((_) => {
|
||||
Promise.resolve(null).then((_) => {
|
||||
fixture.detectChanges();
|
||||
expect(fixture.debugElement.nativeElement).toHaveText('[ hello ]');
|
||||
async.done();
|
||||
|
Reference in New Issue
Block a user