import ngModule from '../module';
import Section from 'salix/components/section';

class Controller extends Section {
    constructor($element, $) {
        super($element, $);
        this.item = {
            relevancy: 0
        };
    }

    onSubmit() {
        this.$.watcher.submit().then(
            json => this.$state.go('item.card.basicData', {id: json.data.id})
        );
    }
}

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

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