chore: router move import changes
This commit is contained in:
parent
d930ad1816
commit
107016ec12
3
build.sh
3
build.sh
@ -41,6 +41,7 @@ for PACKAGE in \
|
|||||||
platform-server \
|
platform-server \
|
||||||
http \
|
http \
|
||||||
router \
|
router \
|
||||||
|
router-deprecated \
|
||||||
upgrade
|
upgrade
|
||||||
do
|
do
|
||||||
SRCDIR=./modules/@angular/${PACKAGE}
|
SRCDIR=./modules/@angular/${PACKAGE}
|
||||||
@ -58,8 +59,10 @@ do
|
|||||||
# safely strips 'readonly' specifier from d.ts files to make them compatible with tsc 1.8
|
# safely strips 'readonly' specifier from d.ts files to make them compatible with tsc 1.8
|
||||||
if [[ ${TRAVIS} ]]; then
|
if [[ ${TRAVIS} ]]; then
|
||||||
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -e 's/\(^ *(static |private )*\)*readonly */\1/g'
|
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -e 's/\(^ *(static |private )*\)*readonly */\1/g'
|
||||||
|
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g'
|
||||||
else
|
else
|
||||||
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\(^ *(static |private )*\)*readonly */\1/g'
|
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -e 's/\(^ *(static |private )*\)*readonly */\1/g'
|
||||||
|
find ${DESTDIR} -type f -name '*.d.ts' -print0 | xargs -0 sed -i '' -E 's/^( +)abstract ([[:alnum:]]+\:)/\1\2/g'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -125,9 +125,9 @@ export class ReflectionCapabilities implements PlatformReflectionCapabilities {
|
|||||||
// API of tsickle for lowering decorators to properties on the class.
|
// API of tsickle for lowering decorators to properties on the class.
|
||||||
if (isPresent((<any>typeOrFunc).ctorParameters)) {
|
if (isPresent((<any>typeOrFunc).ctorParameters)) {
|
||||||
let ctorParameters = (<any>typeOrFunc).ctorParameters;
|
let ctorParameters = (<any>typeOrFunc).ctorParameters;
|
||||||
let paramTypes = ctorParameters.map( ctorParam => ctorParam && ctorParam.type );
|
let paramTypes = ctorParameters.map(ctorParam => ctorParam && ctorParam.type);
|
||||||
let paramAnnotations = ctorParameters.map( ctorParam =>
|
let paramAnnotations = ctorParameters.map(
|
||||||
ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators) );
|
ctorParam => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators));
|
||||||
return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
|
return this._zipTypesAndAnnotations(paramTypes, paramAnnotations);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,9 +182,10 @@ export class ReflectionCapabilities implements PlatformReflectionCapabilities {
|
|||||||
if (isPresent((<any>typeOrFunc).propDecorators)) {
|
if (isPresent((<any>typeOrFunc).propDecorators)) {
|
||||||
let propDecorators = (<any>typeOrFunc).propDecorators;
|
let propDecorators = (<any>typeOrFunc).propDecorators;
|
||||||
let propMetadata = <{[key: string]: any[]}>{};
|
let propMetadata = <{[key: string]: any[]}>{};
|
||||||
Object.keys(propDecorators).forEach( prop => {
|
Object.keys(propDecorators)
|
||||||
propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);
|
.forEach(prop => {
|
||||||
});
|
propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]);
|
||||||
|
});
|
||||||
return propMetadata;
|
return propMetadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,7 +221,7 @@ function convertTsickleDecoratorIntoMetadata(decoratorInvocations: any[]): any[]
|
|||||||
if (!decoratorInvocations) {
|
if (!decoratorInvocations) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return decoratorInvocations.map( decoratorInvocation => {
|
return decoratorInvocations.map(decoratorInvocation => {
|
||||||
var decoratorType = decoratorInvocation.type;
|
var decoratorType = decoratorInvocation.type;
|
||||||
var annotationCls = decoratorType.annotationCls;
|
var annotationCls = decoratorType.annotationCls;
|
||||||
var annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];
|
var annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : [];
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import {provide, Component, ComponentRef} from '@angular/core';
|
import {provide, Component, ComponentRef} from '@angular/core';
|
||||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||||
import {CanActivate, RouteConfig, ComponentInstruction, ROUTER_DIRECTIVES} from '@angular/router';
|
import {
|
||||||
|
CanActivate,
|
||||||
|
RouteConfig,
|
||||||
|
ComponentInstruction,
|
||||||
|
ROUTER_DIRECTIVES
|
||||||
|
} from '@angular/router-deprecated';
|
||||||
import {APP_BASE_HREF} from '@angular/common';
|
import {APP_BASE_HREF} from '@angular/common';
|
||||||
|
|
||||||
function checkIfWeHavePermission(instruction: ComponentInstruction) {
|
function checkIfWeHavePermission(instruction: ComponentInstruction) {
|
||||||
|
@ -6,7 +6,7 @@ import {
|
|||||||
RouteParams,
|
RouteParams,
|
||||||
ComponentInstruction,
|
ComponentInstruction,
|
||||||
ROUTER_DIRECTIVES
|
ROUTER_DIRECTIVES
|
||||||
} from '@angular/router';
|
} from '@angular/router-deprecated';
|
||||||
import {APP_BASE_HREF} from '@angular/common';
|
import {APP_BASE_HREF} from '@angular/common';
|
||||||
|
|
||||||
// #docregion routerCanDeactivate
|
// #docregion routerCanDeactivate
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import {Component, provide, ComponentRef} from '@angular/core';
|
import {Component, provide, ComponentRef} from '@angular/core';
|
||||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||||
import {OnActivate, ComponentInstruction, RouteConfig, ROUTER_DIRECTIVES} from '@angular/router';
|
import {
|
||||||
|
OnActivate,
|
||||||
|
ComponentInstruction,
|
||||||
|
RouteConfig,
|
||||||
|
ROUTER_DIRECTIVES
|
||||||
|
} from '@angular/router-deprecated';
|
||||||
import {APP_BASE_HREF} from '@angular/common';
|
import {APP_BASE_HREF} from '@angular/common';
|
||||||
|
|
||||||
// #docregion routerOnActivate
|
// #docregion routerOnActivate
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import {Component, Injectable, provide, ComponentRef} from '@angular/core';
|
import {Component, Injectable, provide, ComponentRef} from '@angular/core';
|
||||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||||
import {OnDeactivate, ComponentInstruction, RouteConfig, ROUTER_DIRECTIVES} from '@angular/router';
|
import {
|
||||||
|
OnDeactivate,
|
||||||
|
ComponentInstruction,
|
||||||
|
RouteConfig,
|
||||||
|
ROUTER_DIRECTIVES
|
||||||
|
} from '@angular/router-deprecated';
|
||||||
import {APP_BASE_HREF} from '@angular/common';
|
import {APP_BASE_HREF} from '@angular/common';
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
CanReuse,
|
CanReuse,
|
||||||
RouteParams,
|
RouteParams,
|
||||||
OnReuse
|
OnReuse
|
||||||
} from '@angular/router';
|
} from '@angular/router-deprecated';
|
||||||
import {APP_BASE_HREF} from '@angular/common';
|
import {APP_BASE_HREF} from '@angular/common';
|
||||||
|
|
||||||
|
|
||||||
|
@ -445,7 +445,7 @@ var HTTP: string[] = [
|
|||||||
|
|
||||||
var HTTP_TESTING: string[] = ['MockBackend', 'MockConnection'];
|
var HTTP_TESTING: string[] = ['MockBackend', 'MockConnection'];
|
||||||
|
|
||||||
var ROUTER: string[] = [
|
var ROUTER_DEPRECATED: string[] = [
|
||||||
'AsyncRoute',
|
'AsyncRoute',
|
||||||
'AuxRoute',
|
'AuxRoute',
|
||||||
'CanActivate',
|
'CanActivate',
|
||||||
@ -468,7 +468,26 @@ var ROUTER: string[] = [
|
|||||||
'RouterOutlet'
|
'RouterOutlet'
|
||||||
];
|
];
|
||||||
|
|
||||||
var ROUTER_TESTING: string[] = [];
|
var ROUTER_DEPRETACED_TESTING: string[] = [];
|
||||||
|
|
||||||
|
|
||||||
|
var ROUTER: string[] = [
|
||||||
|
'ROUTER_DIRECTIVES',
|
||||||
|
'ROUTER_PROVIDERS',
|
||||||
|
'Route',
|
||||||
|
'Router',
|
||||||
|
'DefaultRouterUrlSerializer',
|
||||||
|
'RouteSegment',
|
||||||
|
'RouteTree',
|
||||||
|
'RouterOutletMap',
|
||||||
|
'RouterUrlSerializer',
|
||||||
|
'Routes',
|
||||||
|
'Tree',
|
||||||
|
'UrlSegment',
|
||||||
|
'UrlTree'
|
||||||
|
];
|
||||||
|
|
||||||
|
var ROUTER_TESTING: string[] = ['ROUTER_FAKE_PROVIDERS'];
|
||||||
|
|
||||||
|
|
||||||
var API = {
|
var API = {
|
||||||
@ -480,6 +499,8 @@ var API = {
|
|||||||
'core/testing': CORE_TESTING,
|
'core/testing': CORE_TESTING,
|
||||||
'http': HTTP,
|
'http': HTTP,
|
||||||
'http/testing': HTTP_TESTING,
|
'http/testing': HTTP_TESTING,
|
||||||
|
'router-deprecated': ROUTER_DEPRECATED,
|
||||||
|
'router-deprecated/testing': ROUTER_DEPRETACED_TESTING,
|
||||||
'router': ROUTER,
|
'router': ROUTER,
|
||||||
'router/testing': ROUTER_TESTING,
|
'router/testing': ROUTER_TESTING,
|
||||||
'upgrade': UPGRADE,
|
'upgrade': UPGRADE,
|
||||||
|
@ -7,6 +7,8 @@ import * as compiler from '@angular/compiler';
|
|||||||
import * as compiler_testing from '@angular/compiler/testing';
|
import * as compiler_testing from '@angular/compiler/testing';
|
||||||
import * as http from '@angular/http';
|
import * as http from '@angular/http';
|
||||||
import * as http_testing from '@angular/http/testing';
|
import * as http_testing from '@angular/http/testing';
|
||||||
|
import * as router_deprecated from '@angular/router-deprecated';
|
||||||
|
import * as router_deprecated_testing from '@angular/router-deprecated/testing';
|
||||||
import * as router from '@angular/router';
|
import * as router from '@angular/router';
|
||||||
import * as router_testing from '@angular/router/testing';
|
import * as router_testing from '@angular/router/testing';
|
||||||
import * as upgrade from '@angular/upgrade';
|
import * as upgrade from '@angular/upgrade';
|
||||||
@ -27,6 +29,8 @@ const LIB_MAP = {
|
|||||||
'core/testing': core_testing,
|
'core/testing': core_testing,
|
||||||
'http': http,
|
'http': http,
|
||||||
'http/testing': http_testing,
|
'http/testing': http_testing,
|
||||||
|
'router-deprecated': router_deprecated,
|
||||||
|
'router-deprecated/testing': router_deprecated_testing,
|
||||||
'router': router,
|
'router': router,
|
||||||
'router/testing': router_testing,
|
'router/testing': router_testing,
|
||||||
'upgrade': upgrade,
|
'upgrade': upgrade,
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import {Provider, NgZone, APP_INITIALIZER} from '@angular/core';
|
import {Provider, NgZone, APP_INITIALIZER} from '@angular/core';
|
||||||
import {PlatformLocation} from '@angular/common';
|
import {PlatformLocation} from '@angular/common';
|
||||||
import {WebWorkerPlatformLocation} from './platform_location';
|
import {WebWorkerPlatformLocation} from './platform_location';
|
||||||
import {ROUTER_PROVIDERS_COMMON} from '@angular/router';
|
import {ROUTER_PROVIDERS} from '@angular/router';
|
||||||
|
|
||||||
export var WORKER_APP_ROUTER = [
|
export var WORKER_APP_ROUTER = [
|
||||||
ROUTER_PROVIDERS_COMMON,
|
ROUTER_PROVIDERS,
|
||||||
/* @ts2dart_Provider */ {provide: PlatformLocation, useClass: WebWorkerPlatformLocation},
|
/* @ts2dart_Provider */ {provide: PlatformLocation, useClass: WebWorkerPlatformLocation},
|
||||||
{
|
{
|
||||||
provide: APP_INITIALIZER,
|
provide: APP_INITIALIZER,
|
||||||
|
@ -18,8 +18,8 @@ import {
|
|||||||
tick,
|
tick,
|
||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
|
|
||||||
import {ROUTER_FAKE_PROVIDERS} from 'angular2/src/alt_router/router_testing_providers';
|
import {ROUTER_FAKE_PROVIDERS} from '@angular/router/testing';
|
||||||
import {ROUTER_DIRECTIVES, Routes, Route} from 'angular2/alt_router';
|
import {ROUTER_DIRECTIVES, Routes, Route} from '@angular/router';
|
||||||
|
|
||||||
|
|
||||||
import {Component, bind} from '@angular/core';
|
import {Component, bind} from '@angular/core';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@angular/router",
|
"name": "@angular/router-deprecated",
|
||||||
"version": "$$ANGULAR_VERSION$$",
|
"version": "$$ANGULAR_VERSION$$",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
entry: '../../../dist/packages-dist/router/esm/index.js',
|
entry: '../../../dist/packages-dist/router-deprecated/esm/index.js',
|
||||||
dest: '../../../dist/packages-dist/router/esm/router.umd.js',
|
dest: '../../../dist/packages-dist/router-deprecated/esm/router-deprecated.umd.js',
|
||||||
sourceMap: true,
|
sourceMap: true,
|
||||||
format: 'umd',
|
format: 'umd',
|
||||||
moduleName: 'ng.router',
|
moduleName: 'ng.router_deprecated',
|
||||||
globals: {
|
globals: {
|
||||||
'@angular/core': 'ng.core',
|
'@angular/core': 'ng.core',
|
||||||
'@angular/common': 'ng.common',
|
'@angular/common': 'ng.common',
|
||||||
|
@ -30,7 +30,7 @@ import {RouterLink} from './src/directives/router_link';
|
|||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* import {Component} from '@angular/core';
|
* import {Component} from '@angular/core';
|
||||||
* import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from '@angular/router';
|
* import {ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from '@angular/router-deprecated';
|
||||||
*
|
*
|
||||||
* @Component({directives: [ROUTER_DIRECTIVES]})
|
* @Component({directives: [ROUTER_DIRECTIVES]})
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
||||||
|
@ -93,7 +93,8 @@ export var BLANK_ROUTE_DATA = new RouteData();
|
|||||||
* ```
|
* ```
|
||||||
* import {Component} from '@angular/core';
|
* import {Component} from '@angular/core';
|
||||||
* import {bootstrap} from '@angular/platform-browser/browser';
|
* import {bootstrap} from '@angular/platform-browser/browser';
|
||||||
* import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from '@angular/router';
|
* import {Router, ROUTER_DIRECTIVES, ROUTER_PROVIDERS, RouteConfig} from
|
||||||
|
* '@angular/router-deprecated';
|
||||||
*
|
*
|
||||||
* @Component({directives: [ROUTER_DIRECTIVES]})
|
* @Component({directives: [ROUTER_DIRECTIVES]})
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
||||||
|
@ -49,7 +49,7 @@ export abstract class AbstractRoute implements RouteDefinition {
|
|||||||
*
|
*
|
||||||
* ### Example
|
* ### Example
|
||||||
* ```
|
* ```
|
||||||
* import {RouteConfig, Route} from '@angular/router';
|
* import {RouteConfig, Route} from '@angular/router-deprecated';
|
||||||
*
|
*
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
||||||
* new Route({path: '/home', component: HomeCmp, name: 'HomeCmp' })
|
* new Route({path: '/home', component: HomeCmp, name: 'HomeCmp' })
|
||||||
@ -87,7 +87,7 @@ export class Route extends AbstractRoute {
|
|||||||
*
|
*
|
||||||
* ### Example
|
* ### Example
|
||||||
* ```
|
* ```
|
||||||
* import {RouteConfig, AuxRoute} from '@angular/router';
|
* import {RouteConfig, AuxRoute} from '@angular/router-deprecated';
|
||||||
*
|
*
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
||||||
* new AuxRoute({path: '/home', component: HomeCmp})
|
* new AuxRoute({path: '/home', component: HomeCmp})
|
||||||
@ -127,7 +127,7 @@ export class AuxRoute extends AbstractRoute {
|
|||||||
*
|
*
|
||||||
* ### Example
|
* ### Example
|
||||||
* ```
|
* ```
|
||||||
* import {RouteConfig, AsyncRoute} from '@angular/router';
|
* import {RouteConfig, AsyncRoute} from '@angular/router-deprecated';
|
||||||
*
|
*
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
||||||
* new AsyncRoute({path: '/home', loader: () => Promise.resolve(MyLoadedCmp), name:
|
* new AsyncRoute({path: '/home', loader: () => Promise.resolve(MyLoadedCmp), name:
|
||||||
@ -166,7 +166,7 @@ export class AsyncRoute extends AbstractRoute {
|
|||||||
*
|
*
|
||||||
* ### Example
|
* ### Example
|
||||||
* ```
|
* ```
|
||||||
* import {RouteConfig, Route, Redirect} from '@angular/router';
|
* import {RouteConfig, Route, Redirect} from '@angular/router-deprecated';
|
||||||
*
|
*
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
||||||
* new Redirect({path: '/', redirectTo: ['/Home'] }),
|
* new Redirect({path: '/', redirectTo: ['/Home'] }),
|
||||||
|
@ -52,7 +52,7 @@ var _resolveToNull = PromiseWrapper.resolve<Instruction>(null);
|
|||||||
* ROUTER_DIRECTIVES,
|
* ROUTER_DIRECTIVES,
|
||||||
* ROUTER_PROVIDERS,
|
* ROUTER_PROVIDERS,
|
||||||
* RouteConfig
|
* RouteConfig
|
||||||
* } from '@angular/router';
|
* } from '@angular/router-deprecated';
|
||||||
*
|
*
|
||||||
* @Component({directives: [ROUTER_DIRECTIVES]})
|
* @Component({directives: [ROUTER_DIRECTIVES]})
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
||||||
|
@ -14,7 +14,7 @@ import {PlatformLocation} from '@angular/common';
|
|||||||
* ROUTER_DIRECTIVES,
|
* ROUTER_DIRECTIVES,
|
||||||
* ROUTER_PROVIDERS,
|
* ROUTER_PROVIDERS,
|
||||||
* RouteConfig
|
* RouteConfig
|
||||||
* } from '@angular/router';
|
* } from '@angular/router-deprecated';
|
||||||
*
|
*
|
||||||
* @Component({directives: [ROUTER_DIRECTIVES]})
|
* @Component({directives: [ROUTER_DIRECTIVES]})
|
||||||
* @RouteConfig([
|
* @RouteConfig([
|
||||||
|
@ -24,9 +24,9 @@ import {
|
|||||||
Route,
|
Route,
|
||||||
RouteParams,
|
RouteParams,
|
||||||
ComponentInstruction
|
ComponentInstruction
|
||||||
} from '@angular/router';
|
} from '@angular/router-deprecated';
|
||||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||||
import {ResolvedInstruction} from '@angular/router/src/instruction';
|
import {ResolvedInstruction} from '@angular/router-deprecated/src/instruction';
|
||||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||||
|
|
||||||
let dummyInstruction = new ResolvedInstruction(
|
let dummyInstruction = new ResolvedInstruction(
|
||||||
|
@ -25,7 +25,7 @@ import {
|
|||||||
Route,
|
Route,
|
||||||
Redirect,
|
Redirect,
|
||||||
AuxRoute
|
AuxRoute
|
||||||
} from '../../../router/src/route_config/route_config_decorator';
|
} from '../../src/route_config/route_config_decorator';
|
||||||
import {PromiseWrapper} from '../../src/facade/async';
|
import {PromiseWrapper} from '../../src/facade/async';
|
||||||
import {BaseException, WrappedException} from '../../src/facade/exceptions';
|
import {BaseException, WrappedException} from '../../src/facade/exceptions';
|
||||||
import {
|
import {
|
||||||
@ -34,7 +34,7 @@ import {
|
|||||||
RouteParams,
|
RouteParams,
|
||||||
Router,
|
Router,
|
||||||
ROUTER_DIRECTIVES
|
ROUTER_DIRECTIVES
|
||||||
} from '@angular/router';
|
} from '@angular/router-deprecated';
|
||||||
|
|
||||||
import {MockLocationStrategy} from '@angular/common/testing';
|
import {MockLocationStrategy} from '@angular/common/testing';
|
||||||
import {ApplicationRef} from '@angular/core/src/application_ref';
|
import {ApplicationRef} from '@angular/core/src/application_ref';
|
||||||
|
@ -14,7 +14,7 @@ import {Location} from '@angular/common';
|
|||||||
|
|
||||||
import {specs, compile, TEST_ROUTER_PROVIDERS, clickOnElement, getHref} from '../util';
|
import {specs, compile, TEST_ROUTER_PROVIDERS, clickOnElement, getHref} from '../util';
|
||||||
|
|
||||||
import {Router, AsyncRoute, Route} from '@angular/router';
|
import {Router, AsyncRoute, Route} from '@angular/router-deprecated';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
HelloCmp,
|
HelloCmp,
|
||||||
|
@ -15,7 +15,7 @@ import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
|||||||
|
|
||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {Router, ROUTER_DIRECTIVES, Route, AuxRoute, RouteConfig} from '@angular/router';
|
import {Router, ROUTER_DIRECTIVES, Route, AuxRoute, RouteConfig} from '@angular/router-deprecated';
|
||||||
import {specs, compile, clickOnElement, getHref} from '../util';
|
import {specs, compile, clickOnElement, getHref} from '../util';
|
||||||
import {BaseException} from '../../../src/facade/exceptions';
|
import {BaseException} from '../../../src/facade/exceptions';
|
||||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||||
|
@ -7,7 +7,7 @@ import {
|
|||||||
RouteParams,
|
RouteParams,
|
||||||
RouteData,
|
RouteData,
|
||||||
ROUTER_DIRECTIVES
|
ROUTER_DIRECTIVES
|
||||||
} from '@angular/router';
|
} from '@angular/router-deprecated';
|
||||||
import {PromiseWrapper} from '../../../src/facade/async';
|
import {PromiseWrapper} from '../../../src/facade/async';
|
||||||
import {isPresent} from '../../../src/facade/lang';
|
import {isPresent} from '../../../src/facade/lang';
|
||||||
import {DynamicComponentLoader} from '@angular/core/src/linker/dynamic_component_loader';
|
import {DynamicComponentLoader} from '@angular/core/src/linker/dynamic_component_loader';
|
||||||
|
@ -12,7 +12,7 @@ import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing'
|
|||||||
|
|
||||||
import {specs, compile, TEST_ROUTER_PROVIDERS, clickOnElement, getHref} from '../util';
|
import {specs, compile, TEST_ROUTER_PROVIDERS, clickOnElement, getHref} from '../util';
|
||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
import {Router, Route} from '@angular/router';
|
import {Router, Route} from '@angular/router-deprecated';
|
||||||
import {
|
import {
|
||||||
HelloCmp,
|
HelloCmp,
|
||||||
UserCmp,
|
UserCmp,
|
||||||
|
@ -22,24 +22,18 @@ import {
|
|||||||
ObservableWrapper
|
ObservableWrapper
|
||||||
} from '../../src/facade/async';
|
} from '../../src/facade/async';
|
||||||
|
|
||||||
import {Router, RouterOutlet, RouterLink, RouteParams} from '@angular/router';
|
import {Router, RouterOutlet, RouterLink, RouteParams} from '@angular/router-deprecated';
|
||||||
import {
|
import {
|
||||||
RouteConfig,
|
RouteConfig,
|
||||||
Route,
|
Route,
|
||||||
AuxRoute,
|
AuxRoute,
|
||||||
AsyncRoute,
|
AsyncRoute,
|
||||||
Redirect
|
Redirect
|
||||||
} from '../../../router/src/route_config/route_config_decorator';
|
} from '../../src/route_config/route_config_decorator';
|
||||||
|
|
||||||
import {
|
import {OnActivate, OnDeactivate, OnReuse, CanDeactivate, CanReuse} from '../../src/interfaces';
|
||||||
OnActivate,
|
import {CanActivate} from '../../src/lifecycle/lifecycle_annotations';
|
||||||
OnDeactivate,
|
import {ComponentInstruction} from '../../src/instruction';
|
||||||
OnReuse,
|
|
||||||
CanDeactivate,
|
|
||||||
CanReuse
|
|
||||||
} from '../../../router/src/interfaces';
|
|
||||||
import {CanActivate} from '../../../router/src/lifecycle/lifecycle_annotations';
|
|
||||||
import {ComponentInstruction} from '../../../router/src/instruction';
|
|
||||||
|
|
||||||
|
|
||||||
import {TEST_ROUTER_PROVIDERS, RootCmp, compile} from './util';
|
import {TEST_ROUTER_PROVIDERS, RootCmp, compile} from './util';
|
||||||
|
@ -17,14 +17,14 @@ import {provide, Component, Injector, Inject} from '@angular/core';
|
|||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
import {PromiseWrapper, TimerWrapper} from '../../src/facade/async';
|
import {PromiseWrapper, TimerWrapper} from '../../src/facade/async';
|
||||||
|
|
||||||
import {Router, RouterOutlet, RouterLink, RouteParams, RouteData} from '@angular/router';
|
import {Router, RouterOutlet, RouterLink, RouteParams, RouteData} from '@angular/router-deprecated';
|
||||||
import {
|
import {
|
||||||
RouteConfig,
|
RouteConfig,
|
||||||
Route,
|
Route,
|
||||||
AuxRoute,
|
AuxRoute,
|
||||||
AsyncRoute,
|
AsyncRoute,
|
||||||
Redirect
|
Redirect
|
||||||
} from '../../../router/src/route_config/route_config_decorator';
|
} from '../../src/route_config/route_config_decorator';
|
||||||
|
|
||||||
import {TEST_ROUTER_PROVIDERS, RootCmp, compile} from './util';
|
import {TEST_ROUTER_PROVIDERS, RootCmp, compile} from './util';
|
||||||
|
|
||||||
|
@ -13,14 +13,14 @@ import {
|
|||||||
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 {Router, RouterOutlet, RouterLink, RouteParams, RouteData} from '@angular/router';
|
import {Router, RouterOutlet, RouterLink, RouteParams, RouteData} from '@angular/router-deprecated';
|
||||||
import {
|
import {
|
||||||
RouteConfig,
|
RouteConfig,
|
||||||
Route,
|
Route,
|
||||||
AuxRoute,
|
AuxRoute,
|
||||||
AsyncRoute,
|
AsyncRoute,
|
||||||
Redirect
|
Redirect
|
||||||
} from '../../../router/src/route_config/route_config_decorator';
|
} from '../../src/route_config/route_config_decorator';
|
||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
|
|
||||||
import {TEST_ROUTER_PROVIDERS, RootCmp, compile} from './util';
|
import {TEST_ROUTER_PROVIDERS, RootCmp, compile} from './util';
|
||||||
|
@ -32,8 +32,8 @@ import {
|
|||||||
RouteConfig,
|
RouteConfig,
|
||||||
ROUTER_DIRECTIVES,
|
ROUTER_DIRECTIVES,
|
||||||
ROUTER_PRIMARY_COMPONENT
|
ROUTER_PRIMARY_COMPONENT
|
||||||
} from '@angular/router';
|
} from '@angular/router-deprecated';
|
||||||
import {RootRouter} from '@angular/router/src/router';
|
import {RootRouter} from '@angular/router-deprecated/src/router';
|
||||||
|
|
||||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||||
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
import {By} from '@angular/platform-browser/src/dom/debug/by';
|
||||||
|
@ -11,10 +11,10 @@ import {
|
|||||||
import {provide, Component} from '@angular/core';
|
import {provide, Component} from '@angular/core';
|
||||||
import {isBlank} from '../../src/facade/lang';
|
import {isBlank} from '../../src/facade/lang';
|
||||||
import {BaseException} from '../../src/facade/exceptions';
|
import {BaseException} from '../../src/facade/exceptions';
|
||||||
import {RootRouter} from '@angular/router/src/router';
|
import {RootRouter} from '@angular/router-deprecated/src/router';
|
||||||
import {Router, ROUTER_DIRECTIVES, ROUTER_PRIMARY_COMPONENT} from '@angular/router';
|
import {Router, ROUTER_DIRECTIVES, ROUTER_PRIMARY_COMPONENT} from '@angular/router-deprecated';
|
||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
import {RouteRegistry} from '@angular/router/src/route_registry';
|
import {RouteRegistry} from '@angular/router-deprecated/src/route_registry';
|
||||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||||
import {SpyLocation} from '@angular/common/testing';
|
import {SpyLocation} from '@angular/common/testing';
|
||||||
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
import {TestComponentBuilder, ComponentFixture} from '@angular/compiler/testing';
|
||||||
|
@ -18,7 +18,7 @@ import {Console} from '@angular/core/src/console';
|
|||||||
import {provide} from '@angular/core';
|
import {provide} from '@angular/core';
|
||||||
import {DOCUMENT} from '@angular/platform-browser/src/dom/dom_tokens';
|
import {DOCUMENT} from '@angular/platform-browser/src/dom/dom_tokens';
|
||||||
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
||||||
import {ROUTER_PROVIDERS, Router, RouteConfig, ROUTER_DIRECTIVES} from '@angular/router';
|
import {ROUTER_PROVIDERS, Router, RouteConfig, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
|
||||||
import {ExceptionHandler} from '@angular/core';
|
import {ExceptionHandler} from '@angular/core';
|
||||||
import {MockLocationStrategy} from '@angular/common/testing';
|
import {MockLocationStrategy} from '@angular/common/testing';
|
||||||
|
|
||||||
|
@ -12,14 +12,14 @@ import {AsyncTestCompleter} from '@angular/core/testing/testing_internal';
|
|||||||
import {PromiseWrapper} from '../src/facade/async';
|
import {PromiseWrapper} from '../src/facade/async';
|
||||||
import {Type, IS_DART} from '../src/facade/lang';
|
import {Type, IS_DART} from '../src/facade/lang';
|
||||||
|
|
||||||
import {RouteRegistry} from '../../router/src/route_registry';
|
import {RouteRegistry} from '../src/route_registry';
|
||||||
import {
|
import {
|
||||||
RouteConfig,
|
RouteConfig,
|
||||||
Route,
|
Route,
|
||||||
Redirect,
|
Redirect,
|
||||||
AuxRoute,
|
AuxRoute,
|
||||||
AsyncRoute
|
AsyncRoute
|
||||||
} from '../../router/src/route_config/route_config_decorator';
|
} from '../src/route_config/route_config_decorator';
|
||||||
|
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
|
@ -14,18 +14,13 @@ import {SpyRouterOutlet} from './spies';
|
|||||||
import {Type} from '../src/facade/lang';
|
import {Type} from '../src/facade/lang';
|
||||||
import {PromiseWrapper, ObservableWrapper} from '../src/facade/async';
|
import {PromiseWrapper, ObservableWrapper} from '../src/facade/async';
|
||||||
import {ListWrapper} from '../src/facade/collection';
|
import {ListWrapper} from '../src/facade/collection';
|
||||||
import {Router, RootRouter} from '@angular/router/src/router';
|
import {Router, RootRouter} from '../src/router';
|
||||||
import {SpyLocation} from '@angular/common/testing';
|
import {SpyLocation} from '@angular/common/testing';
|
||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
import {RouteRegistry, ROUTER_PRIMARY_COMPONENT} from '@angular/router/src/route_registry';
|
import {RouteRegistry, ROUTER_PRIMARY_COMPONENT} from '../src/route_registry';
|
||||||
import {
|
import {RouteConfig, AsyncRoute, Route, Redirect} from '../src/route_config/route_config_decorator';
|
||||||
RouteConfig,
|
|
||||||
AsyncRoute,
|
|
||||||
Route,
|
|
||||||
Redirect
|
|
||||||
} from '@angular/router/src/route_config/route_config_decorator';
|
|
||||||
import {provide} from '@angular/core';
|
import {provide} from '@angular/core';
|
||||||
import {RouterOutlet} from '@angular/router/src/directives/router_outlet';
|
import {RouterOutlet} from '../src/directives/router_outlet';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('Router', () => {
|
describe('Router', () => {
|
||||||
|
@ -8,8 +8,8 @@ import {
|
|||||||
beforeEach,
|
beforeEach,
|
||||||
} from '@angular/core/testing/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {ParamRoutePath} from '../../../../router/src/rules/route_paths/param_route_path';
|
import {ParamRoutePath} from '../../../src/rules/route_paths/param_route_path';
|
||||||
import {parser, Url} from '../../../../router/src/url_parser';
|
import {parser, Url} from '../../../src/url_parser';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('PathRecognizer', () => {
|
describe('PathRecognizer', () => {
|
||||||
|
@ -8,9 +8,9 @@ import {
|
|||||||
beforeEach,
|
beforeEach,
|
||||||
} from '@angular/core/testing/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {GeneratedUrl} from '../../../../router/src/rules/route_paths/route_path';
|
import {GeneratedUrl} from '../../../src/rules/route_paths/route_path';
|
||||||
import {RegexRoutePath} from '../../../../router/src/rules/route_paths/regex_route_path';
|
import {RegexRoutePath} from '../../../src/rules/route_paths/regex_route_path';
|
||||||
import {parser, Url} from '../../../../router/src/url_parser';
|
import {parser, Url} from '../../../src/url_parser';
|
||||||
|
|
||||||
function emptySerializer(params) {
|
function emptySerializer(params) {
|
||||||
return new GeneratedUrl('', {});
|
return new GeneratedUrl('', {});
|
||||||
|
@ -8,11 +8,11 @@ import {
|
|||||||
beforeEach,
|
beforeEach,
|
||||||
} 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 {RouteMatch, PathMatch, RedirectMatch} from '../../../router/src/rules/rules';
|
import {RouteMatch, PathMatch, RedirectMatch} from '../../src/rules/rules';
|
||||||
import {RuleSet} from '../../../router/src/rules/rule_set';
|
import {RuleSet} from '../../src/rules/rule_set';
|
||||||
import {GeneratedUrl} from '../../../router/src/rules/route_paths/route_path';
|
import {GeneratedUrl} from '../../src/rules/route_paths/route_path';
|
||||||
import {Route, Redirect} from '../../../router/src/route_config/route_config_decorator';
|
import {Route, Redirect} from '../../src/route_config/route_config_decorator';
|
||||||
import {parser} from '../../../router/src/url_parser';
|
import {parser} from '../../src/url_parser';
|
||||||
import {PromiseWrapper} from '../../src/facade/promise';
|
import {PromiseWrapper} from '../../src/facade/promise';
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
import {Router, RouterOutlet} from '@angular/router';
|
import {Router, RouterOutlet} from '@angular/router-deprecated';
|
||||||
import {SpyObject, proxy} from '@angular/core/testing/testing_internal';
|
import {SpyObject, proxy} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
export class SpyRouter extends SpyObject {
|
export class SpyRouter extends SpyObject {
|
||||||
|
@ -8,7 +8,7 @@ import {
|
|||||||
beforeEach,
|
beforeEach,
|
||||||
} from '@angular/core/testing/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {UrlParser, Url} from '../../router/src/url_parser';
|
import {UrlParser, Url} from '../src/url_parser';
|
||||||
|
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
|
@ -9,11 +9,11 @@
|
|||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"module": "es2015",
|
"module": "es2015",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "../../../dist/packages-dist/router/esm",
|
"outDir": "../../../dist/packages-dist/router-deprecated/esm",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core/"],
|
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||||
"@angular/common": ["../../../dist/packages-dist/common/"],
|
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser/"]
|
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser"]
|
||||||
},
|
},
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
|
@ -9,10 +9,10 @@
|
|||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"outDir": "../../../dist/packages-dist/router/",
|
"outDir": "../../../dist/packages-dist/router-deprecated/",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@angular/core": ["../../../dist/packages-dist/core/"],
|
"@angular/core": ["../../../dist/packages-dist/core"],
|
||||||
"@angular/common": ["../../../dist/packages-dist/common/"],
|
"@angular/common": ["../../../dist/packages-dist/common"],
|
||||||
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser/"]
|
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser/"]
|
||||||
},
|
},
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
|
@ -4,18 +4,15 @@
|
|||||||
* Alternative implementation of the router. Experimental.
|
* Alternative implementation of the router. Experimental.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export {Router, RouterOutletMap} from './src/alt_router/router';
|
export {Router, RouterOutletMap} from './src/router';
|
||||||
export {RouteSegment, UrlSegment, Tree, UrlTree, RouteTree} from './src/alt_router/segments';
|
export {RouteSegment, UrlSegment, Tree, UrlTree, RouteTree} from './src/segments';
|
||||||
export {Routes} from './src/alt_router/metadata/decorators';
|
export {Routes} from './src/metadata/decorators';
|
||||||
export {Route} from './src/alt_router/metadata/metadata';
|
export {Route} from './src/metadata/metadata';
|
||||||
export {
|
export {RouterUrlSerializer, DefaultRouterUrlSerializer} from './src/router_url_serializer';
|
||||||
RouterUrlSerializer,
|
export {OnActivate, CanDeactivate} from './src/interfaces';
|
||||||
DefaultRouterUrlSerializer
|
export {ROUTER_PROVIDERS} from './src/router_providers';
|
||||||
} from './src/alt_router/router_url_serializer';
|
|
||||||
export {OnActivate, CanDeactivate} from './src/alt_router/interfaces';
|
|
||||||
export {ROUTER_PROVIDERS} from './src/alt_router/router_providers';
|
|
||||||
|
|
||||||
import {RouterOutlet} from './src/alt_router/directives/router_outlet';
|
import {RouterOutlet} from './src/directives/router_outlet';
|
||||||
import {RouterLink} from './src/alt_router/directives/router_link';
|
import {RouterLink} from './src/directives/router_link';
|
||||||
|
|
||||||
export const ROUTER_DIRECTIVES: any[] = /*@ts2dart_const*/[RouterOutlet, RouterLink];
|
export const ROUTER_DIRECTIVES: any[] = /*@ts2dart_const*/[RouterOutlet, RouterLink];
|
||||||
|
15
modules/@angular/router/package.json
Normal file
15
modules/@angular/router/package.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "@angular/router",
|
||||||
|
"version": "$$ANGULAR_VERSION$$",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"jsnext:main": "esm/index.js",
|
||||||
|
"typins": "index.d.ts",
|
||||||
|
"author": "angular",
|
||||||
|
"license": "MIT",
|
||||||
|
"peerDependencies": {
|
||||||
|
"@angular/core": "$$ANGULAR_VERSION$$",
|
||||||
|
"@angular/common": "$$ANGULAR_VERSION$$",
|
||||||
|
"@angular/platform-browser": "$$ANGULAR_VERSION$$"
|
||||||
|
}
|
||||||
|
}
|
1
modules/@angular/router/platform_browser_private.dart
Normal file
1
modules/@angular/router/platform_browser_private.dart
Normal file
@ -0,0 +1 @@
|
|||||||
|
export './platform-browser.dart' show DomAdapter, setRootDomAdapter;
|
4
modules/@angular/router/platform_browser_private.ts
Normal file
4
modules/@angular/router/platform_browser_private.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import {__platform_browser_private__ as _} from '@angular/platform-browser';
|
||||||
|
|
||||||
|
export type DomAdapter = typeof _.DomAdapter;
|
||||||
|
export var getDOM: typeof _.getDOM = _.getDOM;
|
20
modules/@angular/router/rollup.config.js
Normal file
20
modules/@angular/router/rollup.config.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
|
||||||
|
export default {
|
||||||
|
entry: '../../../dist/packages-dist/router/esm/index.js',
|
||||||
|
dest: '../../../dist/packages-dist/router/esm/router.umd.js',
|
||||||
|
sourceMap: true,
|
||||||
|
format: 'umd',
|
||||||
|
moduleName: 'ng.router',
|
||||||
|
globals: {
|
||||||
|
'@angular/core': 'ng.core',
|
||||||
|
'@angular/common': 'ng.common',
|
||||||
|
'@angular/platform-browser': 'ng.platformBrowser',
|
||||||
|
'rxjs/Subject': 'Rx',
|
||||||
|
'rxjs/observable/PromiseObservable': 'Rx', // this is wrong, but this stuff has changed in rxjs b.6 so we need to fix it when we update.
|
||||||
|
'rxjs/operator/toPromise': 'Rx.Observable.prototype',
|
||||||
|
'rxjs/Observable': 'Rx'
|
||||||
|
},
|
||||||
|
plugins: [
|
||||||
|
// nodeResolve({ jsnext: true, main: true }),
|
||||||
|
]
|
||||||
|
}
|
@ -16,8 +16,8 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {RouterOutletMap, Router} from '../router';
|
import {RouterOutletMap, Router} from '../router';
|
||||||
import {RouteSegment, UrlSegment, Tree} from '../segments';
|
import {RouteSegment, UrlSegment, Tree} from '../segments';
|
||||||
import {isString, isPresent} from '@angular/facade/src/lang';
|
import {isString, isPresent} from '../facade/lang';
|
||||||
import {ObservableWrapper} from '@angular/facade/src/async';
|
import {ObservableWrapper} from '../facade/async';
|
||||||
|
|
||||||
@Directive({selector: '[routerLink]'})
|
@Directive({selector: '[routerLink]'})
|
||||||
export class RouterLink implements OnDestroy {
|
export class RouterLink implements OnDestroy {
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {RouterOutletMap} from '../router';
|
import {RouterOutletMap} from '../router';
|
||||||
import {DEFAULT_OUTLET_NAME} from '../constants';
|
import {DEFAULT_OUTLET_NAME} from '../constants';
|
||||||
import {isPresent, isBlank} from '@angular/facade/src/lang';
|
import {isPresent, isBlank} from '../facade/lang';
|
||||||
|
|
||||||
@Directive({selector: 'router-outlet'})
|
@Directive({selector: 'router-outlet'})
|
||||||
export class RouterOutlet {
|
export class RouterOutlet {
|
||||||
|
1
modules/@angular/router/src/facade
Symbolic link
1
modules/@angular/router/src/facade
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
../../facade/src
|
@ -1,4 +1,4 @@
|
|||||||
import {Type, isBlank} from '@angular/facade/src/lang';
|
import {Type, isBlank} from './facade/lang';
|
||||||
|
|
||||||
export function hasLifecycleHook(name: string, obj: Object): boolean {
|
export function hasLifecycleHook(name: string, obj: Object): boolean {
|
||||||
if (isBlank(obj)) return false;
|
if (isBlank(obj)) return false;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {Tree, TreeNode, UrlSegment, RouteSegment, rootNode, UrlTree, RouteTree} from './segments';
|
import {Tree, TreeNode, UrlSegment, RouteSegment, rootNode, UrlTree, RouteTree} from './segments';
|
||||||
import {isBlank, isPresent, isString, isStringMap} from '@angular/facade/src/lang';
|
import {isBlank, isPresent, isString, isStringMap} from './facade/lang';
|
||||||
import {ListWrapper} from '@angular/facade/src/collection';
|
import {ListWrapper} from './facade/collection';
|
||||||
|
|
||||||
export function link(segment: RouteSegment, routeTree: RouteTree, urlTree: UrlTree,
|
export function link(segment: RouteSegment, routeTree: RouteTree, urlTree: UrlTree,
|
||||||
change: any[]): UrlTree {
|
change: any[]): UrlTree {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import {Type, stringify} from "@angular/facade/src/lang";
|
import {Type} from '@angular/core';
|
||||||
|
import {stringify} from "../facade/lang";
|
||||||
|
|
||||||
export abstract class RouteMetadata {
|
export abstract class RouteMetadata {
|
||||||
abstract get path(): string;
|
abstract get path(): string;
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import {RouteSegment, UrlSegment, Tree, TreeNode, rootNode, UrlTree, RouteTree} from './segments';
|
import {RouteSegment, UrlSegment, Tree, TreeNode, rootNode, UrlTree, RouteTree} from './segments';
|
||||||
import {RoutesMetadata, RouteMetadata} from './metadata/metadata';
|
import {RoutesMetadata, RouteMetadata} from './metadata/metadata';
|
||||||
import {Type, isBlank, isPresent, stringify} from '@angular/facade/src/lang';
|
import {Type, isBlank, isPresent, stringify} from './facade/lang';
|
||||||
import {ListWrapper, StringMapWrapper} from '@angular/facade/src/collection';
|
import {ListWrapper, StringMapWrapper} from './facade/collection';
|
||||||
import {PromiseWrapper} from '@angular/facade/src/promise';
|
import {PromiseWrapper} from './facade/promise';
|
||||||
import {BaseException} from '@angular/core';
|
import {BaseException} from '@angular/core';
|
||||||
import {ComponentResolver} from '@angular/core';
|
import {ComponentResolver} from '@angular/core';
|
||||||
import {DEFAULT_OUTLET_NAME} from './constants';
|
import {DEFAULT_OUTLET_NAME} from './constants';
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
import {OnInit, provide, ReflectiveInjector, ComponentResolver} from '@angular/core';
|
import {OnInit, provide, ReflectiveInjector, ComponentResolver} from '@angular/core';
|
||||||
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 './facade/lang';
|
||||||
import {ListWrapper} from '@angular/facade/src/collection';
|
import {ListWrapper} from './facade/collection';
|
||||||
import {
|
import {EventEmitter, Observable, PromiseWrapper, ObservableWrapper} from './facade/async';
|
||||||
EventEmitter,
|
import {StringMapWrapper} from './facade/collection';
|
||||||
Observable,
|
|
||||||
PromiseWrapper,
|
|
||||||
ObservableWrapper
|
|
||||||
} from '@angular/facade/src/async';
|
|
||||||
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';
|
||||||
import {CanDeactivate} from './interfaces';
|
import {CanDeactivate} from './interfaces';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {UrlSegment, Tree, TreeNode, rootNode, UrlTree} from './segments';
|
import {UrlSegment, Tree, TreeNode, rootNode, UrlTree} from './segments';
|
||||||
import {BaseException} from '@angular/core';
|
import {BaseException} from '@angular/core';
|
||||||
import {isBlank, isPresent, RegExpWrapper} from '@angular/facade/src/lang';
|
import {isBlank, isPresent, RegExpWrapper} from './facade/lang';
|
||||||
|
|
||||||
export abstract class RouterUrlSerializer {
|
export abstract class RouterUrlSerializer {
|
||||||
abstract parse(url: string): UrlTree;
|
abstract parse(url: string): UrlTree;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {ComponentFactory, Type} from '@angular/core';
|
import {ComponentFactory, Type} from '@angular/core';
|
||||||
import {StringMapWrapper, ListWrapper} from '@angular/facade/src/collection';
|
import {StringMapWrapper, ListWrapper} from './facade/collection';
|
||||||
import {isBlank, isPresent, stringify} from '@angular/facade/src/lang';
|
import {isBlank, isPresent, stringify} from './facade/lang';
|
||||||
|
|
||||||
export class Tree<T> {
|
export class Tree<T> {
|
||||||
/** @internal */
|
/** @internal */
|
||||||
|
@ -1,23 +1,20 @@
|
|||||||
import {
|
import {
|
||||||
ComponentFixture,
|
|
||||||
AsyncTestCompleter,
|
AsyncTestCompleter,
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
xdescribe,
|
xdescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
expect,
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
it,
|
it,
|
||||||
xit,
|
xit
|
||||||
fakeAsync,
|
} from '@angular/core/testing/testing_internal';
|
||||||
tick
|
import {fakeAsync, tick} from '@angular/core/testing';
|
||||||
} from 'angular2/testing_internal';
|
import {ComponentFixture, TestComponentBuilder} from '@angular/compiler/testing';
|
||||||
import {provide, Component, ComponentResolver} from 'angular2/core';
|
import {provide, Component, ComponentResolver} from '@angular/core';
|
||||||
import {PromiseWrapper} from 'angular2/src/facade/async';
|
import {PromiseWrapper} from '../src/facade/async';
|
||||||
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@ -31,10 +28,10 @@ import {
|
|||||||
DefaultRouterUrlSerializer,
|
DefaultRouterUrlSerializer,
|
||||||
OnActivate,
|
OnActivate,
|
||||||
CanDeactivate
|
CanDeactivate
|
||||||
} from 'angular2/alt_router';
|
} from '@angular/router';
|
||||||
import {SpyLocation} from 'angular2/src/mock/location_mock';
|
import {SpyLocation} from '@angular/common/testing';
|
||||||
import {Location} from 'angular2/platform/common';
|
import {Location} from '@angular/common';
|
||||||
import {DOM} from 'angular2/src/platform/dom/dom_adapter';
|
import {getDOM} from '../platform_browser_private';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('navigation', () => {
|
describe('navigation', () => {
|
||||||
@ -155,7 +152,7 @@ export function main() {
|
|||||||
expect(location.path()).toEqual('/team/22/cannotDeactivate');
|
expect(location.path()).toEqual('/team/22/cannotDeactivate');
|
||||||
})));
|
})));
|
||||||
|
|
||||||
if (DOM.supportsDOMEvents()) {
|
if (getDOM().supportsDOMEvents()) {
|
||||||
it("should support absolute router links",
|
it("should support absolute router links",
|
||||||
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
fakeAsync(inject([Router, TestComponentBuilder], (router, tcb) => {
|
||||||
let fixture = tcb.createFakeAsync(RootCmp);
|
let fixture = tcb.createFakeAsync(RootCmp);
|
||||||
@ -165,9 +162,9 @@ export function main() {
|
|||||||
advance(fixture);
|
advance(fixture);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('team 22 { link, aux: }');
|
expect(fixture.debugElement.nativeElement).toHaveText('team 22 { link, aux: }');
|
||||||
|
|
||||||
let native = DOM.querySelector(fixture.debugElement.nativeElement, "a");
|
let native = getDOM().querySelector(fixture.debugElement.nativeElement, "a");
|
||||||
expect(DOM.getAttribute(native, "href")).toEqual("/team/33/simple");
|
expect(getDOM().getAttribute(native, "href")).toEqual("/team/33/simple");
|
||||||
DOM.dispatchEvent(native, DOM.createMouseEvent('click'));
|
getDOM().dispatchEvent(native, getDOM().createMouseEvent('click'));
|
||||||
advance(fixture);
|
advance(fixture);
|
||||||
|
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('team 33 { simple, aux: }');
|
expect(fixture.debugElement.nativeElement).toHaveText('team 33 { simple, aux: }');
|
||||||
@ -183,9 +180,9 @@ export function main() {
|
|||||||
expect(fixture.debugElement.nativeElement)
|
expect(fixture.debugElement.nativeElement)
|
||||||
.toHaveText('team 22 { relativelink { }, aux: }');
|
.toHaveText('team 22 { relativelink { }, aux: }');
|
||||||
|
|
||||||
let native = DOM.querySelector(fixture.debugElement.nativeElement, "a");
|
let native = getDOM().querySelector(fixture.debugElement.nativeElement, "a");
|
||||||
expect(DOM.getAttribute(native, "href")).toEqual("/team/22/relativelink/simple");
|
expect(getDOM().getAttribute(native, "href")).toEqual("/team/22/relativelink/simple");
|
||||||
DOM.dispatchEvent(native, DOM.createMouseEvent('click'));
|
getDOM().dispatchEvent(native, getDOM().createMouseEvent('click'));
|
||||||
advance(fixture);
|
advance(fixture);
|
||||||
|
|
||||||
expect(fixture.debugElement.nativeElement)
|
expect(fixture.debugElement.nativeElement)
|
||||||
@ -201,13 +198,13 @@ export function main() {
|
|||||||
advance(fixture);
|
advance(fixture);
|
||||||
expect(fixture.debugElement.nativeElement)
|
expect(fixture.debugElement.nativeElement)
|
||||||
.toHaveText('team 22 { relativelink { }, aux: }');
|
.toHaveText('team 22 { relativelink { }, aux: }');
|
||||||
let link = DOM.querySelector(fixture.debugElement.nativeElement, "a");
|
let link = getDOM().querySelector(fixture.debugElement.nativeElement, "a");
|
||||||
expect(DOM.hasClass(link, "router-link-active")).toEqual(false);
|
expect(getDOM().hasClass(link, "router-link-active")).toEqual(false);
|
||||||
|
|
||||||
DOM.dispatchEvent(link, DOM.createMouseEvent('click'));
|
getDOM().dispatchEvent(link, getDOM().createMouseEvent('click'));
|
||||||
advance(fixture);
|
advance(fixture);
|
||||||
|
|
||||||
expect(DOM.hasClass(link, "router-link-active")).toEqual(true);
|
expect(getDOM().hasClass(link, "router-link-active")).toEqual(true);
|
||||||
})));
|
})));
|
||||||
|
|
||||||
it("should update router links when router changes",
|
it("should update router links when router changes",
|
||||||
@ -219,13 +216,13 @@ export function main() {
|
|||||||
advance(fixture);
|
advance(fixture);
|
||||||
expect(fixture.debugElement.nativeElement).toHaveText('team 22 { link, aux: simple }');
|
expect(fixture.debugElement.nativeElement).toHaveText('team 22 { link, aux: simple }');
|
||||||
|
|
||||||
let native = DOM.querySelector(fixture.debugElement.nativeElement, "a");
|
let native = getDOM().querySelector(fixture.debugElement.nativeElement, "a");
|
||||||
expect(DOM.getAttribute(native, "href")).toEqual("/team/33/simple(aux:simple)");
|
expect(getDOM().getAttribute(native, "href")).toEqual("/team/33/simple(aux:simple)");
|
||||||
|
|
||||||
router.navigateByUrl('/team/22/link(simple2)');
|
router.navigateByUrl('/team/22/link(simple2)');
|
||||||
advance(fixture);
|
advance(fixture);
|
||||||
|
|
||||||
expect(DOM.getAttribute(native, "href")).toEqual("/team/33/simple(aux:simple2)");
|
expect(getDOM().getAttribute(native, "href")).toEqual("/team/33/simple(aux:simple2)");
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,29 +1,20 @@
|
|||||||
import {
|
import {
|
||||||
ComponentFixture,
|
|
||||||
AsyncTestCompleter,
|
AsyncTestCompleter,
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
xdescribe,
|
xdescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
expect,
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
it,
|
it,
|
||||||
xit
|
xit
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {
|
import {RouteSegment, UrlSegment, UrlTree, TreeNode, RouteTree} from '../src/segments';
|
||||||
RouteSegment,
|
import {link} from '../src/link';
|
||||||
UrlSegment,
|
import {DefaultRouterUrlSerializer} from '../src/router_url_serializer';
|
||||||
UrlTree,
|
|
||||||
TreeNode,
|
|
||||||
RouteTree
|
|
||||||
} from 'angular2/src/alt_router/segments';
|
|
||||||
import {link} from 'angular2/src/alt_router/link';
|
|
||||||
import {DefaultRouterUrlSerializer} from 'angular2/src/alt_router/router_url_serializer';
|
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('link', () => {
|
describe('link', () => {
|
||||||
@ -105,4 +96,4 @@ export function main() {
|
|||||||
function s(u: UrlSegment): RouteTree {
|
function s(u: UrlSegment): RouteTree {
|
||||||
let root = new TreeNode<RouteSegment>(new RouteSegment([u], {}, null, null, null), []);
|
let root = new TreeNode<RouteSegment>(new RouteSegment([u], {}, null, null, null), []);
|
||||||
return new RouteTree(root);
|
return new RouteTree(root);
|
||||||
}
|
}
|
||||||
|
@ -1,26 +1,23 @@
|
|||||||
import {
|
import {
|
||||||
ComponentFixture,
|
|
||||||
AsyncTestCompleter,
|
AsyncTestCompleter,
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
xdescribe,
|
xdescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
expect,
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
it,
|
it,
|
||||||
xit
|
xit
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {recognize} from 'angular2/src/alt_router/recognize';
|
import {recognize} from '../src/recognize';
|
||||||
import {Routes, Route} from 'angular2/alt_router';
|
import {Routes, Route} from '@angular/router';
|
||||||
import {provide, Component, ComponentResolver} from 'angular2/core';
|
import {provide, Component, ComponentResolver} from '@angular/core';
|
||||||
import {UrlSegment, RouteTree, UrlTree} from 'angular2/src/alt_router/segments';
|
import {UrlSegment, RouteTree, UrlTree} from '../src/segments';
|
||||||
import {DefaultRouterUrlSerializer} from 'angular2/src/alt_router/router_url_serializer';
|
import {DefaultRouterUrlSerializer} from '../src/router_url_serializer';
|
||||||
import {DEFAULT_OUTLET_NAME} from 'angular2/src/alt_router/constants';
|
import {DEFAULT_OUTLET_NAME} from '../src/constants';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('recognize', () => {
|
describe('recognize', () => {
|
||||||
@ -241,4 +238,4 @@ class ComponentG {
|
|||||||
new Route({path: "f", component: ComponentF})
|
new Route({path: "f", component: ComponentF})
|
||||||
])
|
])
|
||||||
class ComponentA {
|
class ComponentA {
|
||||||
}
|
}
|
||||||
|
@ -1,22 +1,19 @@
|
|||||||
import {
|
import {
|
||||||
ComponentFixture,
|
|
||||||
AsyncTestCompleter,
|
AsyncTestCompleter,
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
xdescribe,
|
xdescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
expect,
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
it,
|
it,
|
||||||
xit
|
xit
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {DefaultRouterUrlSerializer} from 'angular2/src/alt_router/router_url_serializer';
|
import {DefaultRouterUrlSerializer} from '../src/router_url_serializer';
|
||||||
import {UrlSegment} from 'angular2/src/alt_router/segments';
|
import {UrlSegment} from '../src/segments';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('url serializer', () => {
|
describe('url serializer', () => {
|
||||||
@ -111,4 +108,4 @@ export function main() {
|
|||||||
|
|
||||||
function expectSegment(segment: UrlSegment, expected: string): void {
|
function expectSegment(segment: UrlSegment, expected: string): void {
|
||||||
expect(segment.toString()).toEqual(expected);
|
expect(segment.toString()).toEqual(expected);
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,18 @@
|
|||||||
import {
|
import {
|
||||||
ComponentFixture,
|
|
||||||
AsyncTestCompleter,
|
AsyncTestCompleter,
|
||||||
TestComponentBuilder,
|
|
||||||
beforeEach,
|
beforeEach,
|
||||||
ddescribe,
|
ddescribe,
|
||||||
xdescribe,
|
xdescribe,
|
||||||
describe,
|
describe,
|
||||||
el,
|
|
||||||
expect,
|
expect,
|
||||||
iit,
|
iit,
|
||||||
inject,
|
inject,
|
||||||
beforeEachProviders,
|
beforeEachProviders,
|
||||||
it,
|
it,
|
||||||
xit
|
xit
|
||||||
} from 'angular2/testing_internal';
|
} from '@angular/core/testing/testing_internal';
|
||||||
|
|
||||||
import {Tree, TreeNode} from 'angular2/src/alt_router/segments';
|
import {Tree, TreeNode} from '../src/segments';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
describe('tree', () => {
|
describe('tree', () => {
|
||||||
@ -66,4 +63,4 @@ export function main() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
1
modules/@angular/router/testing.ts
Normal file
1
modules/@angular/router/testing.ts
Normal file
@ -0,0 +1 @@
|
|||||||
|
export * from './testing/router_testing_providers';
|
@ -1,7 +1,7 @@
|
|||||||
import {SpyLocation} from '@angular/common/testing';
|
import {SpyLocation} from '@angular/common/testing';
|
||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
import {Router, RouterOutletMap} from './router';
|
import {Router, RouterOutletMap} from '../src/router';
|
||||||
import {RouterUrlSerializer, DefaultRouterUrlSerializer} from './router_url_serializer';
|
import {RouterUrlSerializer, DefaultRouterUrlSerializer} from '../src/router_url_serializer';
|
||||||
import {Component, ComponentResolver} from '@angular/core';
|
import {Component, ComponentResolver} from '@angular/core';
|
||||||
|
|
||||||
@Component({selector: 'fake-app-root-comp', template: `<span></span>`})
|
@Component({selector: 'fake-app-root-comp', template: `<span></span>`})
|
||||||
|
29
modules/@angular/router/tsconfig-es2015.json
Normal file
29
modules/@angular/router/tsconfig-es2015.json
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"skipTemplateCodegen": true
|
||||||
|
},
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
|
"declaration": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"module": "es2015",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"outDir": "../../../dist/packages-dist/router/esm",
|
||||||
|
"paths": {
|
||||||
|
"@angular/core": ["../../../dist/packages-dist/core/"],
|
||||||
|
"@angular/common": ["../../../dist/packages-dist/common/"],
|
||||||
|
"@angular/common/testing": ["../../../dist/packages-dist/common/testing/"],
|
||||||
|
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser/"]
|
||||||
|
},
|
||||||
|
"rootDir": ".",
|
||||||
|
"sourceMap": true,
|
||||||
|
"sourceRoot": ".",
|
||||||
|
"target": "es2015"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"index.ts",
|
||||||
|
"testing.ts",
|
||||||
|
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||||
|
]
|
||||||
|
}
|
32
modules/@angular/router/tsconfig.json
Normal file
32
modules/@angular/router/tsconfig.json
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"angularCompilerOptions": {
|
||||||
|
"skipTemplateCodegen": true
|
||||||
|
},
|
||||||
|
"compilerOptions": {
|
||||||
|
"baseUrl": ".",
|
||||||
|
"declaration": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"module": "commonjs",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"outDir": "../../../dist/packages-dist/router/",
|
||||||
|
"paths": {
|
||||||
|
"@angular/core": ["../../../dist/packages-dist/core/"],
|
||||||
|
"@angular/common": ["../../../dist/packages-dist/common/"],
|
||||||
|
"@angular/common/testing": ["../../../dist/packages-dist/common/testing/"],
|
||||||
|
"@angular/platform-browser": ["../../../dist/packages-dist/platform-browser/"]
|
||||||
|
},
|
||||||
|
"rootDir": ".",
|
||||||
|
"sourceMap": true,
|
||||||
|
"sourceRoot": ".",
|
||||||
|
"target": "es5"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"index.ts",
|
||||||
|
"testing.ts",
|
||||||
|
"../typings/es6-collections/es6-collections.d.ts",
|
||||||
|
"../typings/es6-promise/es6-promise.d.ts",
|
||||||
|
"../manual_typings/globals.d.ts",
|
||||||
|
"../../../node_modules/zone.js/dist/zone.js.d.ts"
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
library playground.e2e_test.routing.routing_spec;
|
||||||
|
|
||||||
|
main() {}
|
91
modules/playground/e2e_test/alt_routing/routing_spec.ts
Normal file
91
modules/playground/e2e_test/alt_routing/routing_spec.ts
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
import {verifyNoBrowserErrors} from '@angular/platform-browser/testing_e2e';
|
||||||
|
|
||||||
|
function waitForElement(selector) {
|
||||||
|
var EC = (<any>protractor).ExpectedConditions;
|
||||||
|
// Waits for the element with id 'abc' to be present on the dom.
|
||||||
|
browser.wait(EC.presenceOf($(selector)), 20000);
|
||||||
|
}
|
||||||
|
|
||||||
|
describe('alt-routing inbox-app', () => {
|
||||||
|
|
||||||
|
afterEach(verifyNoBrowserErrors);
|
||||||
|
|
||||||
|
describe('index view', () => {
|
||||||
|
var URL = 'all/playground/src/alt_routing/';
|
||||||
|
|
||||||
|
it('should list out the current collection of items', () => {
|
||||||
|
browser.get(URL);
|
||||||
|
waitForElement('.inbox-item-record');
|
||||||
|
expect(element.all(by.css('.inbox-item-record')).count()).toEqual(200);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should build a link which points to the detail page', () => {
|
||||||
|
browser.get(URL);
|
||||||
|
waitForElement('#item-15');
|
||||||
|
expect(element(by.css('#item-15')).getAttribute('href')).toMatch(/\/detail\/15$/);
|
||||||
|
element(by.css('#item-15')).click();
|
||||||
|
waitForElement('#record-id');
|
||||||
|
expect(browser.getCurrentUrl()).toMatch(/\/detail\/15$/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
describe('drafts view', () => {
|
||||||
|
var URL = 'all/playground/src/alt_routing/#/drafts';
|
||||||
|
|
||||||
|
it('should navigate to the drafts view when the drafts link is clicked', () => {
|
||||||
|
browser.get(URL);
|
||||||
|
waitForElement('.inbox-item-record');
|
||||||
|
element(by.linkText('Drafts')).click();
|
||||||
|
waitForElement('.page-title');
|
||||||
|
expect(element(by.css('.page-title')).getText()).toEqual('Drafts');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should navigate to email details', () => {
|
||||||
|
browser.get(URL);
|
||||||
|
element(by.linkText('Drafts')).click();
|
||||||
|
waitForElement('.inbox-item-record');
|
||||||
|
expect(element.all(by.css('.inbox-item-record')).count()).toEqual(2);
|
||||||
|
expect(element(by.css('#item-201')).getAttribute('href')).toMatch(/\/detail\/201$/);
|
||||||
|
element(by.css('#item-201')).click();
|
||||||
|
waitForElement('#record-id');
|
||||||
|
expect(browser.getCurrentUrl()).toMatch(/\/detail\/201$/);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
describe('detail view', () => {
|
||||||
|
var URL = 'all/playground/src/alt_routing/';
|
||||||
|
|
||||||
|
it('should navigate to the detail view when an email is clicked', () => {
|
||||||
|
browser.get(URL);
|
||||||
|
waitForElement('#item-10');
|
||||||
|
element(by.css('#item-10')).click();
|
||||||
|
waitForElement('#record-id');
|
||||||
|
var recordId = element(by.css("#record-id"));
|
||||||
|
browser.wait(protractor.until.elementTextIs(recordId, "ID: 10"), 5000);
|
||||||
|
expect(recordId.getText()).toEqual('ID: 10');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should navigate back to the email inbox page when the back button is clicked', () => {
|
||||||
|
browser.get(URL);
|
||||||
|
waitForElement('#item-10');
|
||||||
|
element(by.css('#item-10')).click();
|
||||||
|
waitForElement('.back-button');
|
||||||
|
element(by.css('.back-button')).click();
|
||||||
|
expect(browser.getCurrentUrl()).toMatch(/\/$/);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should navigate back to index and sort the page items based on the provided querystring param',
|
||||||
|
() => {
|
||||||
|
browser.get(URL);
|
||||||
|
waitForElement('#item-10');
|
||||||
|
element(by.css('#item-10')).click();
|
||||||
|
waitForElement('.sort-button');
|
||||||
|
element(by.css('.sort-button')).click();
|
||||||
|
expect(browser.getCurrentUrl()).toMatch(/\/;sort=date$/);
|
||||||
|
waitForElement('.inbox-item-record');
|
||||||
|
expect(element(by.css(".inbox-item-record > a")).getAttribute("id")).toEqual("item-137");
|
||||||
|
});
|
||||||
|
})
|
||||||
|
});
|
@ -9,7 +9,7 @@ import {
|
|||||||
RouteSegment,
|
RouteSegment,
|
||||||
RouteTree,
|
RouteTree,
|
||||||
UrlTree
|
UrlTree
|
||||||
} from 'angular2/alt_router';
|
} from '@angular/router';
|
||||||
import * as db from './data';
|
import * as db from './data';
|
||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
import {PromiseWrapper} from '@angular/core/src/facade/async';
|
import {PromiseWrapper} from '@angular/core/src/facade/async';
|
||||||
|
@ -25,55 +25,36 @@ declare var System: any;
|
|||||||
'@angular/common': '/packages-dist/common/common.umd.js',
|
'@angular/common': '/packages-dist/common/common.umd.js',
|
||||||
'@angular/compiler': '/packages-dist/compiler/compiler.umd.js',
|
'@angular/compiler': '/packages-dist/compiler/compiler.umd.js',
|
||||||
'@angular/platform-browser': '/packages-dist/platform-browser/platform-browser.umd.js',
|
'@angular/platform-browser': '/packages-dist/platform-browser/platform-browser.umd.js',
|
||||||
'@angular/platform-browser-dynamic': '/packages-dist/platform-browser-dynamic/platform-browser-dynamic.umd.js',
|
'@angular/platform-browser-dynamic':
|
||||||
|
'/packages-dist/platform-browser-dynamic/platform-browser-dynamic.umd.js',
|
||||||
'@angular/http': '/packages-dist/http/http.umd.js',
|
'@angular/http': '/packages-dist/http/http.umd.js',
|
||||||
'@angular/upgrade': '/packages-dist/upgrade/upgrade.umd.js',
|
'@angular/upgrade': '/packages-dist/upgrade/upgrade.umd.js',
|
||||||
'@angular/router': '/packages-dist/router/router.umd.js',
|
'@angular/router': '/packages-dist/router/router.umd.js',
|
||||||
|
'@angular/router-deprecated': '/packages-dist/router-deprecated/router-deprecated.umd.js',
|
||||||
'@angular/core/src/facade': '/all/@angular/core/src/facade',
|
'@angular/core/src/facade': '/all/@angular/core/src/facade',
|
||||||
'rxjs': location.pathname.replace(/index\.html$/, '') + 'rxjs'
|
'rxjs': location.pathname.replace(/index\.html$/, '') + 'rxjs'
|
||||||
},
|
},
|
||||||
packages: {
|
packages: {
|
||||||
'app': {
|
'app': {defaultExtension: 'js'},
|
||||||
defaultExtension: 'js'
|
'@angular/core/src/facade': {defaultExtension: 'js'}
|
||||||
},
|
|
||||||
'@angular/core/src/facade': {
|
|
||||||
defaultExtension: 'js'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.warn("Not using the Angular bundles. Don't use this configuration for e2e/performance tests!");
|
console.warn(
|
||||||
|
"Not using the Angular bundles. Don't use this configuration for e2e/performance tests!");
|
||||||
|
|
||||||
System.config({
|
System.config({
|
||||||
map: {
|
map: {'index': 'index.js', '@angular': '/all/@angular'},
|
||||||
'index': 'index.js',
|
|
||||||
'@angular': '/all/@angular'
|
|
||||||
},
|
|
||||||
packages: {
|
packages: {
|
||||||
// 'app': {
|
// 'app': {
|
||||||
// main: 'index.js',
|
// main: 'index.js',
|
||||||
// defaultExtension: 'js'
|
// defaultExtension: 'js'
|
||||||
// },
|
// },
|
||||||
'@angular/core': {
|
'@angular/core': {main: 'index.js', defaultExtension: 'js'},
|
||||||
main: 'index.js',
|
'@angular/compiler': {main: 'index.js', defaultExtension: 'js'},
|
||||||
defaultExtension: 'js'
|
'@angular/common': {main: 'index.js', defaultExtension: 'js'},
|
||||||
},
|
'@angular/platform-browser': {main: 'index.js', defaultExtension: 'js'},
|
||||||
'@angular/compiler': {
|
'@angular/platform-browser-dynamic': {main: 'index.js', defaultExtension: 'js'}
|
||||||
main: 'index.js',
|
|
||||||
defaultExtension: 'js'
|
|
||||||
},
|
|
||||||
'@angular/common': {
|
|
||||||
main: 'index.js',
|
|
||||||
defaultExtension: 'js'
|
|
||||||
},
|
|
||||||
'@angular/platform-browser': {
|
|
||||||
main: 'index.js',
|
|
||||||
defaultExtension: 'js'
|
|
||||||
},
|
|
||||||
'@angular/platform-browser-dynamic': {
|
|
||||||
main: 'index.js',
|
|
||||||
defaultExtension: 'js'
|
|
||||||
}
|
|
||||||
// 'rxjs': {
|
// 'rxjs': {
|
||||||
// defaultExtension: 'js'
|
// defaultExtension: 'js'
|
||||||
// }
|
// }
|
||||||
@ -83,9 +64,7 @@ declare var System: any;
|
|||||||
|
|
||||||
|
|
||||||
// BOOTSTRAP the app!
|
// BOOTSTRAP the app!
|
||||||
System.import('index').then(function (m) {
|
System.import('index').then(function(m) { m.main(); }, console.error.bind(console));
|
||||||
m.main();
|
|
||||||
}, console.error.bind(console));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {Component, provide} from '@angular/core';
|
import {Component, provide} from '@angular/core';
|
||||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||||
import {RouteConfig, Route, ROUTER_PROVIDERS, ROUTER_DIRECTIVES} from '@angular/router';
|
import {RouteConfig, Route, ROUTER_PROVIDERS, ROUTER_DIRECTIVES} from '@angular/router-deprecated';
|
||||||
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
|
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,5 +1,12 @@
|
|||||||
import {Component, Injectable} from '@angular/core';
|
import {Component, Injectable} from '@angular/core';
|
||||||
import {RouterLink, RouteConfig, Router, Route, RouterOutlet, RouteParams} from '@angular/router';
|
import {
|
||||||
|
RouterLink,
|
||||||
|
RouteConfig,
|
||||||
|
Router,
|
||||||
|
Route,
|
||||||
|
RouterOutlet,
|
||||||
|
RouteParams
|
||||||
|
} from '@angular/router-deprecated';
|
||||||
import * as db from './data';
|
import * as db from './data';
|
||||||
import {Location} from '@angular/common';
|
import {Location} from '@angular/common';
|
||||||
import {PromiseWrapper, PromiseCompleter} from '@angular/core/src/facade/async';
|
import {PromiseWrapper, PromiseCompleter} from '@angular/core/src/facade/async';
|
||||||
@ -81,7 +88,8 @@ class DbService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Component({selector: 'inbox-detail', directives: [RouterLink], templateUrl: 'app/inbox-detail.html'})
|
@Component(
|
||||||
|
{selector: 'inbox-detail', directives: [RouterLink], templateUrl: 'app/inbox-detail.html'})
|
||||||
class InboxDetailCmp {
|
class InboxDetailCmp {
|
||||||
record: InboxRecord = new InboxRecord();
|
record: InboxRecord = new InboxRecord();
|
||||||
ready: boolean = false;
|
ready: boolean = false;
|
||||||
|
@ -2,7 +2,7 @@ import {InboxApp} from './app/inbox-app';
|
|||||||
import {provide} from '@angular/core';
|
import {provide} from '@angular/core';
|
||||||
import {bootstrap} from '@angular/platform-browser-dynamic';
|
import {bootstrap} from '@angular/platform-browser-dynamic';
|
||||||
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
|
import {HashLocationStrategy, LocationStrategy} from '@angular/common';
|
||||||
import {ROUTER_PROVIDERS} from '@angular/router';
|
import {ROUTER_PROVIDERS} from '@angular/router-deprecated';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
bootstrap(InboxApp,
|
bootstrap(InboxApp,
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
import {PromiseWrapper} from '@angular/core/src/facade/async';
|
import {PromiseWrapper} from '@angular/core/src/facade/async';
|
||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {
|
import {ServiceMessageBrokerFactory, PRIMITIVE} from '@angular/platform-browser/src/worker_app';
|
||||||
ServiceMessageBrokerFactory,
|
;
|
||||||
PRIMITIVE
|
|
||||||
} from '@angular/platform-browser/src/worker_app';;
|
|
||||||
|
|
||||||
const ECHO_CHANNEL = "ECHO";
|
const ECHO_CHANNEL = "ECHO";
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import {Component} from '@angular/core';
|
|||||||
import {Start} from './components/start';
|
import {Start} from './components/start';
|
||||||
import {About} from './components/about';
|
import {About} from './components/about';
|
||||||
import {Contact} from './components/contact';
|
import {Contact} from './components/contact';
|
||||||
import {ROUTER_DIRECTIVES, RouteConfig, Route} from '@angular/router';
|
import {ROUTER_DIRECTIVES, RouteConfig, Route} from '@angular/router-deprecated';
|
||||||
|
|
||||||
@Component({selector: 'app', directives: [ROUTER_DIRECTIVES], templateUrl: 'app.html'})
|
@Component({selector: 'app', directives: [ROUTER_DIRECTIVES], templateUrl: 'app.html'})
|
||||||
@RouteConfig([
|
@RouteConfig([
|
||||||
|
@ -19,7 +19,6 @@ exports.config = {
|
|||||||
'dist/all/**/e2e_test/**/*_spec.js'
|
'dist/all/**/e2e_test/**/*_spec.js'
|
||||||
],
|
],
|
||||||
exclude: [
|
exclude: [
|
||||||
'**/alt_routing/**', // temporary package
|
|
||||||
'**/web_workers/**', // needs to be setup
|
'**/web_workers/**', // needs to be setup
|
||||||
'**/key_events/**', // can't tell why this is failing
|
'**/key_events/**', // can't tell why this is failing
|
||||||
'**/sourcemap/**' // fails only on travis
|
'**/sourcemap/**' // fails only on travis
|
||||||
|
@ -17,8 +17,7 @@ System.config({
|
|||||||
'parse5/index': 'dist/all/empty.js',
|
'parse5/index': 'dist/all/empty.js',
|
||||||
'@angular/platform-server/src/parse5_adapter': 'dist/all/empty.js',
|
'@angular/platform-server/src/parse5_adapter': 'dist/all/empty.js',
|
||||||
'angular2/*': 'dist/all/angular2/*.js',
|
'angular2/*': 'dist/all/angular2/*.js',
|
||||||
'angular2/src/alt_router/router_testing_providers': 'dist/all/angular2/src/alt_router/router_testing_providers.js',
|
'angular2/src/alt_router/router_testing_providers': 'dist/all/angular2/src/alt_router/router_testing_providers.js'
|
||||||
'angular2/alt_router': 'dist/all/angular2/alt_router.js'
|
|
||||||
},
|
},
|
||||||
packages: {
|
packages: {
|
||||||
'@angular/core': {
|
'@angular/core': {
|
||||||
@ -42,6 +41,10 @@ System.config({
|
|||||||
main: 'index.js',
|
main: 'index.js',
|
||||||
defaultExtension: 'js'
|
defaultExtension: 'js'
|
||||||
},
|
},
|
||||||
|
'@angular/router-deprecated': {
|
||||||
|
main: 'index.js',
|
||||||
|
defaultExtension: 'js'
|
||||||
|
},
|
||||||
'@angular/http': {
|
'@angular/http': {
|
||||||
main: 'index.js',
|
main: 'index.js',
|
||||||
defaultExtension: 'js'
|
defaultExtension: 'js'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user