1778 Refactor worker.phone

This commit is contained in:
Bernat 2019-10-18 13:52:15 +02:00
parent b78447bdd7
commit 85bcb356d4
2 changed files with 12 additions and 10 deletions

View File

@ -1,9 +1,8 @@
import ngModule from '../module';
class Controller {
constructor($scope, $stateParams) {
constructor($scope) {
this.$scope = $scope;
this.$stateParams = $stateParams;
}
get worker() {
@ -12,13 +11,16 @@ class Controller {
set worker(value) {
this._worker = value;
if (value) {
if (value)
this.setLink(value);
}
setLink(value) {
this.$scope.$applyAsync(()=> {
this.$scope.model.link = {userFk: value.userFk};
this.$scope.model.refresh();
});
}
}
onSubmit() {
this.$scope.watcher.check();
@ -34,7 +36,7 @@ class Controller {
}
}
Controller.$inject = ['$scope', '$stateParams'];
Controller.$inject = ['$scope'];
ngModule.component('vnWorkerPhones', {
template: require('./index.html'),

View File

@ -8,7 +8,7 @@
{"state": "worker.card.pbx", "icon": "icon-pbx"},
{"state": "worker.card.calendar", "icon": "icon-calendar"},
{"state": "worker.card.timeControl", "icon": "access_time"},
{"state": "worker.card.phones", "icon": "icon-pbx"}
{"state": "worker.card.phones", "icon": "contact_phone"}
],
"routes": [
{