salix/modules/client/front/card/index.js

32 lines
685 B
JavaScript
Raw Normal View History

2017-06-03 11:01:47 +00:00
import ngModule from '../module';
2017-12-20 13:36:12 +00:00
2017-06-03 11:01:47 +00:00
export default class Controller {
constructor($scope, $stateParams, $http) {
2018-05-02 09:54:13 +00:00
this.$scope = $scope;
this.$http = $http;
this.$stateParams = $stateParams;
2017-05-23 08:58:17 +00:00
this.client = null;
}
2018-05-02 09:54:13 +00:00
$onInit() {
this.getCard();
}
getCard() {
this.$http.get(`/client/api/Clients/${this.$stateParams.id}/getCard`).then(response => {
this.client = response.data;
});
}
2018-05-02 09:54:13 +00:00
reload() {
this.getCard();
2018-05-02 09:54:13 +00:00
}
2017-05-23 08:58:17 +00:00
}
Controller.$inject = ['$scope', '$stateParams', '$http'];
2017-06-03 11:01:47 +00:00
ngModule.component('vnClientCard', {
2018-05-23 12:26:51 +00:00
template: require('./index.html'),
2017-10-05 07:20:40 +00:00
controller: Controller
2017-05-23 08:58:17 +00:00
});
2018-05-02 09:54:13 +00:00