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.basicData', {id: json.data.id})
        );
    }
}

Controller.$inject = ['$scope', '$state'];

ngModule.component('vnItemCreate', {
    template: require('./index.html'),
    controller: Controller
});