import ngModule from '../module'; import Section from 'salix/components/section'; class Controller extends Section { constructor($element, $) { super($element, $); } onSubmit() { this.$.watcher.submit().then( json => { this.$state.go('item.card.basicData', {id: json.data.id}); redirect(this.$.$ctrl); function redirect(ctrl) { window.location.href = `/#!/supplier/${ctrl.supplier.supplier.id}/fiscal-data`; } } ); } } Controller.$inject = ['$element', '$scope']; ngModule.vnComponent('vnSupplierCreate', { template: require('./index.html'), controller: Controller });