import ngModule from '../module'; class Controller { constructor($scope, $stateParams) { this.$scope = $scope; this.$stateParams = $stateParams; } add() { this.$scope.model.insert({ taxClassFk: 2, quantity: 1, ticketFk: this.$stateParams.id }); } onSubmit() { this.$scope.watcher.check(); this.$scope.model.save().then(() => { this.$scope.watcher.notifySaved(); this.$scope.model.refresh(); }); } } Controller.$inject = ['$scope', '$stateParams']; ngModule.component('vnTicketService', { template: require('./index.html'), controller: Controller });