refactor(router): renamed RouterAppModule into RouterModule
This commit is contained in:
parent
7f4954bed6
commit
c43dd5a655
|
@ -14,7 +14,7 @@ export {RouterLinkActive} from './src/directives/router_link_active';
|
||||||
export {RouterOutlet} from './src/directives/router_outlet';
|
export {RouterOutlet} from './src/directives/router_outlet';
|
||||||
export {CanActivate, CanDeactivate, Resolve} from './src/interfaces';
|
export {CanActivate, CanDeactivate, Resolve} from './src/interfaces';
|
||||||
export {Event, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router, RoutesRecognized} from './src/router';
|
export {Event, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, Router, RoutesRecognized} from './src/router';
|
||||||
export {ROUTER_DIRECTIVES, RouterAppModule} from './src/router_app_module';
|
export {ROUTER_DIRECTIVES, RouterModule} from './src/router_module';
|
||||||
export {RouterOutletMap} from './src/router_outlet_map';
|
export {RouterOutletMap} from './src/router_outlet_map';
|
||||||
export {provideRouter} from './src/router_providers';
|
export {provideRouter} from './src/router_providers';
|
||||||
export {ActivatedRoute, ActivatedRouteSnapshot, RouterState, RouterStateSnapshot} from './src/router_state';
|
export {ActivatedRoute, ActivatedRouteSnapshot, RouterState, RouterStateSnapshot} from './src/router_state';
|
||||||
|
|
|
@ -80,7 +80,7 @@ export function setupRouterInitializer(injector: Injector) {
|
||||||
* bootstrap(AppCmp, [provideRouter(config)]);
|
* bootstrap(AppCmp, [provideRouter(config)]);
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @deprecated use RouterAppModule instead
|
* @deprecated use RouterModule instead
|
||||||
*/
|
*/
|
||||||
export function provideRouter(routes: Routes, config: ExtraOptions): any[] {
|
export function provideRouter(routes: Routes, config: ExtraOptions): any[] {
|
||||||
return [
|
return [
|
||||||
|
|
|
@ -32,7 +32,7 @@ export const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref,
|
||||||
* ### Example
|
* ### Example
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* bootstrap(AppCmp, {modules: [RouterAppModule]});
|
* bootstrap(AppCmp, {modules: [RouterModule]});
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @experimental
|
* @experimental
|
||||||
|
@ -55,7 +55,7 @@ export const ROUTER_DIRECTIVES = [RouterOutlet, RouterLink, RouterLinkWithHref,
|
||||||
{provide: ROUTER_CONFIGURATION, useValue: {enableTracing: false}}
|
{provide: ROUTER_CONFIGURATION, useValue: {enableTracing: false}}
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class RouterAppModule {
|
export class RouterModule {
|
||||||
constructor(private injector: Injector) {
|
constructor(private injector: Injector) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const appRef = injector.get(ApplicationRef);
|
const appRef = injector.get(ApplicationRef);
|
|
@ -9,7 +9,7 @@
|
||||||
import {InboxApp, ROUTER_CONFIG} from './app/inbox-app';
|
import {InboxApp, ROUTER_CONFIG} from './app/inbox-app';
|
||||||
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 {provideRoutes, RouterAppModule} from '@angular/router';
|
import {provideRoutes, RouterModule} from '@angular/router';
|
||||||
|
|
||||||
export function main() {
|
export function main() {
|
||||||
bootstrap(InboxApp, {
|
bootstrap(InboxApp, {
|
||||||
|
@ -17,6 +17,6 @@ export function main() {
|
||||||
provideRoutes(ROUTER_CONFIG),
|
provideRoutes(ROUTER_CONFIG),
|
||||||
{provide: LocationStrategy, useClass: HashLocationStrategy}
|
{provide: LocationStrategy, useClass: HashLocationStrategy}
|
||||||
],
|
],
|
||||||
modules: [RouterAppModule]
|
modules: [RouterModule]
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
Reference in New Issue