summaryrefslogtreecommitdiffstats
path: root/testapi/opnfv_testapi/ui/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'testapi/opnfv_testapi/ui/app.js')
-rw-r--r--testapi/opnfv_testapi/ui/app.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/testapi/opnfv_testapi/ui/app.js b/testapi/opnfv_testapi/ui/app.js
index ada7577..3fb4bc7 100644
--- a/testapi/opnfv_testapi/ui/app.js
+++ b/testapi/opnfv_testapi/ui/app.js
@@ -19,7 +19,7 @@
angular
.module('testapiApp', [
'ui.router','ui.bootstrap', 'cgBusy',
- 'ngResource', 'angular-confirm'
+ 'ngResource', 'angular-confirm', 'angular-json-tree'
]);
angular
@@ -64,6 +64,21 @@
angular
.module('testapiApp')
+ .service('dataFieldService', function(){
+ this.dataFunction = dataFunction
+ function dataFunction(data, data_field){
+ Object.keys(data).forEach(function (key) {
+ if (typeof data[key] === 'object' && data[key] != null) {
+ return dataFunction(data[key], data_field);
+ }
+ data_field[key] = key.replace(/_/g, " ").trim();
+ });
+ return data_field;
+ }
+ });
+
+ angular
+ .module('testapiApp')
.directive('dynamicModel', ['$compile', '$parse', function ($compile, $parse) {
return {
restrict: 'A',