blob: d05c2781440b981c18804f9bb50c93e59e98aa03 [file] [log] [blame]
(function () {
'use strict';
angular.module('mCord')
.directive('eNodeDetails', function () {
return {
restrict: 'E',
scope: {},
controllerAs: 'vm',
templateUrl: 'app/view/enode-details/e-node-details.tpl.html',
controller: function($stateParams, Enodeb, NgMap){
Enodeb.get({id: $stateParams.id}).$promise
.then((enode) => {
this.enode = enode;
return NgMap.getMap();
})
.then((map) => {
const center = map.getCenter();
console.log(center.lat(), center.lng());
});
this.config = {
exclude: ['ProfileArray', 'Status'],
formName: 'updateEnode',
actions: [
{
label: 'Save',
icon: 'ok', // refers to bootstraps glyphicon
cb: (enode) => { // receive the model
enode.$save();
},
class: 'success'
}
]
};
}
}
});
}());