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

View File

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