salix/modules/item/front/create/index.js

25 lines
507 B
JavaScript

import ngModule from '../module';
class Controller {
constructor($scope, $state) {
this.$ = $scope;
this.$state = $state;
this.item = {
relevancy: 0
};
}
onSubmit() {
this.$.watcher.submit().then(
json => this.$state.go('item.card.data', {id: json.data.id})
);
}
}
Controller.$inject = ['$scope', '$state'];
ngModule.component('vnItemCreate', {
template: require('./index.html'),
controller: Controller
});