Make Config table options available to angular
This commit is contained in:
parent
92bfac0aad
commit
ad65fa1820
|
@ -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) {
|
||||
return function(scope, elm, attrs) {
|
||||
scope.$watch(attrs.angularHtmlBind, function(newValue, oldValue) {
|
||||
|
|
|
@ -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};
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue