29 lines
564 B
JavaScript
29 lines
564 B
JavaScript
|
import ngModule from '../module';
|
||
|
|
||
|
class Controller {
|
||
|
constructor($http, $stateParams) {
|
||
|
Object.assign(this, {
|
||
|
$http,
|
||
|
$stateParams,
|
||
|
});
|
||
|
}
|
||
|
|
||
|
$onInit() {
|
||
|
this.reload();
|
||
|
}
|
||
|
|
||
|
reload() {
|
||
|
let query = `api/Workers/${this.$stateParams.id}`;
|
||
|
this.$http.get(query).then(res => {
|
||
|
this.worker = res.data;
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
Controller.$inject = ['$http', '$stateParams'];
|
||
|
|
||
|
ngModule.component('vnWorkerCard', {
|
||
|
template: require('./index.html'),
|
||
|
controller: Controller
|
||
|
});
|