2017-12-20 11:40:29 +00:00
|
|
|
import ngModule from '../module';
|
|
|
|
|
2018-05-25 08:03:45 +00:00
|
|
|
class Controller {
|
2018-01-10 11:49:52 +00:00
|
|
|
constructor($scope, $state) {
|
|
|
|
this.$ = $scope;
|
|
|
|
this.$state = $state;
|
|
|
|
this.item = {
|
|
|
|
relevancy: 0
|
|
|
|
};
|
2017-12-20 11:40:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
onSubmit() {
|
|
|
|
this.$.watcher.submit().then(
|
2018-01-10 11:49:52 +00:00
|
|
|
json => this.$state.go('item.card.data', {id: json.data.id})
|
2017-12-20 11:40:29 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2018-05-25 08:03:45 +00:00
|
|
|
|
|
|
|
Controller.$inject = ['$scope', '$state'];
|
2017-12-20 11:40:29 +00:00
|
|
|
|
|
|
|
ngModule.component('vnItemCreate', {
|
2018-05-25 08:03:45 +00:00
|
|
|
template: require('./index.html'),
|
|
|
|
controller: Controller
|
2017-12-20 11:40:29 +00:00
|
|
|
});
|