Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
The Routing service is used by LinkComponent, and provides facilities for
the component/view layer to interact with the router.
This is a private service for internal usage only. For public usage,
refer to the `Router` service.
@private
@class RoutingService
*/
export default Service.extend({
router: null,
targetState: readOnly('router.targetState'),
currentState: readOnly('router.currentState'),
currentRouteName: readOnly('router.currentRouteName'),
currentPath: readOnly('router.currentPath'),
hasRoute(routeName) {
return get(this, 'router').hasRoute(routeName);
},
transitionTo(routeName, models, queryParams, shouldReplace) {
let router = get(this, 'router');
let transition = router._doTransition(routeName, models, queryParams);
if (shouldReplace) {
transition.method('replace');
}
return transition;
},
/**
The Routing service is used by LinkComponent, and provides facilities for
the component/view layer to interact with the router.
This is a private service for internal usage only. For public usage,
refer to the `Router` service.
@private
@class RoutingService
*/
export default Service.extend({
router: null,
targetState: readOnly('router.targetState'),
currentState: readOnly('router.currentState'),
currentRouteName: readOnly('router.currentRouteName'),
currentPath: readOnly('router.currentPath'),
hasRoute(routeName) {
return get(this, 'router').hasRoute(routeName);
},
transitionTo(routeName, models, queryParams, shouldReplace) {
let router = get(this, 'router');
let transition = router._doTransition(routeName, models, queryParams);
if (shouldReplace) {
transition.method('replace');
}
return transition;
import { routeArgs } from '../utils';
/**
The Routing service is used by LinkComponent, and provides facilities for
the component/view layer to interact with the router.
This is a private service for internal usage only. For public usage,
refer to the `Router` service.
@private
@class RoutingService
*/
export default Service.extend({
router: null,
targetState: readOnly('router.targetState'),
currentState: readOnly('router.currentState'),
currentRouteName: readOnly('router.currentRouteName'),
currentPath: readOnly('router.currentPath'),
hasRoute(routeName) {
return get(this, 'router').hasRoute(routeName);
},
transitionTo(routeName, models, queryParams, shouldReplace) {
let router = get(this, 'router');
let transition = router._doTransition(routeName, models, queryParams);
if (shouldReplace) {
transition.method('replace');
}
/**
The Routing service is used by LinkComponent, and provides facilities for
the component/view layer to interact with the router.
This is a private service for internal usage only. For public usage,
refer to the `Router` service.
@private
@class RoutingService
*/
export default Service.extend({
router: null,
targetState: readOnly('router.targetState'),
currentState: readOnly('router.currentState'),
currentRouteName: readOnly('router.currentRouteName'),
currentPath: readOnly('router.currentPath'),
hasRoute(routeName) {
return get(this, 'router').hasRoute(routeName);
},
transitionTo(routeName, models, queryParams, shouldReplace) {
let router = get(this, 'router');
let transition = router._doTransition(routeName, models, queryParams);
if (shouldReplace) {
transition.method('replace');
}