mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
App annotation/mode attribute
This commit is contained in:
@ -1,13 +1,4 @@
|
||||
import {
|
||||
RegExp,
|
||||
RegExpWrapper,
|
||||
RegExpMatcherWrapper,
|
||||
StringWrapper,
|
||||
isPresent,
|
||||
isBlank,
|
||||
BaseException,
|
||||
normalizeBlank
|
||||
} from 'angular2/src/facade/lang';
|
||||
import {RegExpWrapper} from 'angular2/src/facade/lang';
|
||||
|
||||
import * as util from '../util/util';
|
||||
import {PathRecognizer} from './path-recognizer';
|
||||
@ -25,14 +16,19 @@ export class IonicRouter {
|
||||
}
|
||||
|
||||
config(config) {
|
||||
for (let routeName in config) {
|
||||
this.addRoute(routeName, config[routeName]);
|
||||
if (config) {
|
||||
for (let routeName in config) {
|
||||
this.addRoute(routeName, config[routeName]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addRoute(routeName, routeConfig) {
|
||||
if (routeName && routeConfig && routeConfig.path) {
|
||||
this._routes[routeName] = new Route(routeName, routeConfig)
|
||||
this._routes[routeName] = new Route(routeName, routeConfig);
|
||||
if (routeConfig.root) {
|
||||
this.otherwise(routeName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user