import ngModule from '../module'; import './style.scss'; class Controller { constructor($stateParams, $, $http, vnApp, $translate) { this.vnApp = vnApp; this.$translate = $translate; this.$ = $; this.$stateParams = $stateParams; this.$http = $http; } addStowaway(stowaway) { let params = {id: stowaway.id, shipFk: this.ticket.id}; this.$http.post(`/api/Stowaways/`, params) .then(() => { this.cardReload(); this.vnApp.showSuccess(this.$translate.instant('Data saved!')); this.$.dialog.hide(); }); } show() { this.$.dialog.show(); } hide() { this.$.dialog.hide(); } } Controller.$inject = ['$stateParams', '$scope', '$http', 'vnApp', '$translate']; ngModule.component('vnAddStowaway', { template: require('./addStowaway.html'), controller: Controller, bindings: { ticket: '<', cardReload: '&?' } });