Class RouterService
publicDefined in: | packages/ember-routing/lib/services/router.js:15 |
---|---|
Module: | ember |
currentRouteName public
Module: | ember |
---|
Defined in packages/ember-routing/lib/services/router.js:25
Name of the current route.
This property represent the logical name of the route, which is comma separated. For the following router:
app/router.js
Router.map(function() { this.route('about); this.route('blog', function () { this.route('post', { path: ':post_id' }); }); });
It will return:
-
index
when you visit/
-
about
when you visit/about
-
blog.index
when you visit/blog
-
blog.post
when you visit/blog/some-post-id
currentURL public
Module: | ember |
---|
Defined in packages/ember-routing/lib/services/router.js:54
Current URL for the application.
This property represent the URL path for this route. For the following router:
app/router.js
Router.map(function() { this.route('about); this.route('blog', function () { this.route('post', { path: ':post_id' }); }); });
It will return:
-
/
when you visit/
-
/about
when you visit/about
-
/blog/index
when you visit/blog
-
/blog/post
when you visit/blog/some-post-id
location public
Module: | ember |
---|
Defined in packages/ember-routing/lib/services/router.js:82
The location
property determines the type of URL's that your application will use. The following location types are currently available:
auto
hash
history
none
rootURL public
Module: | ember |
---|
Defined in packages/ember-routing/lib/services/router.js:98
The rootURL
property represents the URL of the root of the application, '/' by default. This prefix is assumed on all routes defined on this app.
IF you change the rootURL
in your environment configuration like so:
config/environment.js
'use strict'; module.exports = function(environment) { let ENV = { modulePrefix: 'router-service', environment, rootURL: '/my-root', … } ]
This property will return /my-root
.
© 2020 Yehuda Katz, Tom Dale and Ember.js contributors
Licensed under the MIT License.
https://api.emberjs.com/ember/2.18/classes/RouterService/properties