mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
fix(nav-registry): NavRegistry is a singleton
This commit is contained in:
@@ -206,6 +206,7 @@ class AnotherPage {
|
||||
|
||||
|
||||
@App({
|
||||
pages: [FirstPage, FullPage, PrimaryHeaderPage, AnotherPage],
|
||||
template: `<ion-nav [root]="root"></ion-nav>`
|
||||
})
|
||||
class E2EApp {
|
||||
|
||||
@@ -20,9 +20,12 @@ import {initTapClick} from '../components/tap-click/tap-click';
|
||||
import * as dom from '../util/dom';
|
||||
|
||||
|
||||
export function ionicProviders(config) {
|
||||
export function ionicProviders(args) {
|
||||
let app = new IonicApp();
|
||||
let platform = new Platform();
|
||||
let navRegistry = new NavRegistry(args.pages);
|
||||
|
||||
var config = args.config;
|
||||
|
||||
if (!(config instanceof Config)) {
|
||||
config = new Config(config);
|
||||
@@ -50,6 +53,7 @@ export function ionicProviders(config) {
|
||||
provide(Platform, {useValue: platform}),
|
||||
provide(FeatureDetect, {useValue: featureDetect}),
|
||||
provide(Events, {useValue: events}),
|
||||
provide(NavRegistry, {useValue: navRegistry}),
|
||||
Form,
|
||||
Keyboard,
|
||||
OverlayController,
|
||||
@@ -57,7 +61,6 @@ export function ionicProviders(config) {
|
||||
Modal,
|
||||
Popup,
|
||||
Translate,
|
||||
NavRegistry,
|
||||
ROUTER_PROVIDERS,
|
||||
provide(LocationStrategy, {useClass: HashLocationStrategy}),
|
||||
HTTP_PROVIDERS,
|
||||
|
||||
@@ -135,7 +135,7 @@ export function App(args={}) {
|
||||
Reflect.defineMetadata('annotations', annotations, cls);
|
||||
|
||||
console.time('bootstrap');
|
||||
bootstrap(cls, ionicProviders(args.config)).then(() => {
|
||||
bootstrap(cls, ionicProviders(args)).then(() => {
|
||||
console.timeEnd('bootstrap');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user