21 lines
476 B
JavaScript
21 lines
476 B
JavaScript
|
import ngModule from '../module';
|
||
|
|
||
|
export default class Controller {
|
||
|
constructor($scope, $state) {
|
||
|
this.$scope = $scope;
|
||
|
this.$state = $state;
|
||
|
}
|
||
|
|
||
|
onSubmit() {
|
||
|
this.$scope.watcher.submit().then(
|
||
|
res => this.$state.go('route.card.summary', {id: res.data.id})
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
Controller.$inject = ['$scope', '$state'];
|
||
|
|
||
|
ngModule.component('vnRouteCreate', {
|
||
|
template: require('./index.html'),
|
||
|
controller: Controller
|
||
|
});
|