2016-06-26 20:21:45 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular.module('ffffngAdmin')
|
|
|
|
.directive('faVersion', function ($http, $state, notification) {
|
|
|
|
var link = function (scope) {
|
|
|
|
scope.version = '?';
|
2016-06-26 22:00:58 +02:00
|
|
|
$http.get('/api/version')
|
2016-06-26 20:21:45 +02:00
|
|
|
.then(function (result) { scope.version = result.data.version; })
|
|
|
|
.catch(function (e) {
|
|
|
|
notification.log('Error: ' + e.data, { addnCls: 'humane-flatty-error' });
|
|
|
|
console.error(e);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
return {
|
|
|
|
'link': link,
|
|
|
|
'restrict': 'E',
|
|
|
|
'scope': {},
|
|
|
|
|
|
|
|
'template': '{{version}}'
|
|
|
|
};
|
|
|
|
});
|