-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE ember-routing-router-service] - Implementing phase 1 of public
Router Service RFC
- Loading branch information
Showing
7 changed files
with
590 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
@module ember | ||
@submodule ember-routing | ||
*/ | ||
|
||
import { | ||
Service, | ||
readOnly | ||
} from 'ember-runtime'; | ||
import { get } from 'ember-metal'; | ||
import RouterDSL from '../system/dsl'; | ||
|
||
/** | ||
The Router service is the public API that provides component/view layer | ||
access to the router. | ||
@public | ||
@class RouterService | ||
@category ember-routing-router-service | ||
*/ | ||
const RouterService = Service.extend({ | ||
currentRouteName: readOnly('router.currentRouteName'), | ||
currentURL: readOnly('router.currentURL'), | ||
location: readOnly('router.location'), | ||
rootURL: readOnly('router.rootURL'), | ||
|
||
/** | ||
Transition the application into another route. The route may | ||
be either a single route or route path: | ||
See [Route.transitionTo](http://emberjs.com/api/classes/Ember.Route.html#method_transitionTo) for more info. | ||
@method transitionTo | ||
@category ember-routing-router-service | ||
@param {String} name the name of the route or a URL | ||
@param {...Object} models the model(s) or identifier(s) to be used while | ||
transitioning to the route. | ||
@param {Object} [options] optional hash with a queryParams property | ||
containing a mapping of query parameters | ||
@return {Transition} the transition object associated with this | ||
attempted transition | ||
@public | ||
*/ | ||
transitionTo() { | ||
this.router.transitionTo(...arguments); | ||
} | ||
}); | ||
|
||
export default RouterService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.