posibilidad de añadir paramateros a las rutas
This commit is contained in:
parent
7d32f95c23
commit
c8dcf2b971
|
@ -2,6 +2,7 @@ export default class FilterClientList {
|
|||
constructor($scope, $timeout, $state) {
|
||||
this.$ = $scope;
|
||||
this.$timeout = $timeout;
|
||||
this.$state = $state;
|
||||
|
||||
this.waitingMgCrud = 0;
|
||||
this.clientFk = $state.params.id;
|
||||
|
|
|
@ -68,9 +68,9 @@ export default class Watcher extends Component {
|
|||
*
|
||||
* @param {String} state The state name
|
||||
*/
|
||||
submitGo(state) {
|
||||
submitGo(state, params) {
|
||||
return this.submit().then(
|
||||
() => this.$state.go(state)
|
||||
() => this.$state.go(state, params || {})
|
||||
);
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -47,9 +47,8 @@ function config($stateProvider, $urlRouterProvider, aclServiceProvider, modulesF
|
|||
for (let i = 0; i < count; i++) {
|
||||
let route = fileRoutes[i];
|
||||
if (aclService.routeHasPermission(route)) {
|
||||
$stateProvider.state(route.state, {
|
||||
let configRoute = {
|
||||
url: route.url,
|
||||
abstract: route.abstract || false,
|
||||
template: `<${route.component} ${getParams(route)}></${route.component}>`,
|
||||
resolve: {
|
||||
loader: loader(moduleName, validations)
|
||||
|
@ -57,7 +56,13 @@ function config($stateProvider, $urlRouterProvider, aclServiceProvider, modulesF
|
|||
data: {
|
||||
routes: fileRoutes
|
||||
}
|
||||
});
|
||||
};
|
||||
if (route.abstract)
|
||||
configRoute.abstract = true;
|
||||
if (route.routeParams)
|
||||
configRoute.params = route.routeParams;
|
||||
|
||||
$stateProvider.state(route.state, configRoute);
|
||||
} else if (route.state === mainModule.state) {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue