Make Config table options available to angular

This commit is contained in:
Kyle Johnson 2014-11-20 04:10:01 +00:00
parent 92bfac0aad
commit ad65fa1820
2 changed files with 18 additions and 0 deletions

View File

@ -33,6 +33,15 @@ ZoneMinder.factory('Console', function($http) {
}; };
}); });
ZoneMinder.factory('Config', function($http) {
return {
setConfigModel: function() {
return $http.get('/api/configs/keyValue.json')
},
};
});
ZoneMinder.directive('angularHtmlBind', function($compile) { ZoneMinder.directive('angularHtmlBind', function($compile) {
return function(scope, elm, attrs) { return function(scope, elm, attrs) {
scope.$watch(attrs.angularHtmlBind, function(newValue, oldValue) { scope.$watch(attrs.angularHtmlBind, function(newValue, oldValue) {

View File

@ -45,3 +45,12 @@ ZoneMinder.controller('ConsoleController', function($scope, Console) {
} }
}); });
}); });
ZoneMinder.controller('ConfigController', function($scope, $http, Config) {
Config.setConfigModel().then(function(results) {
$scope.myModel = {configData: results.data.keyValues};
});
});