From db0ce1f5c6305fa4f996aaa79575bbfe8d235937 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Tue, 3 Mar 2015 09:37:57 -0500 Subject: [PATCH] Resolve configData in options state before load This commit will pass in a $scope.configData array to the 'options' state before the page loads. This ensures that the config data is in scope before the page loads. --- web/js/app.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web/js/app.js b/web/js/app.js index b4f8d670a..df8c82af4 100644 --- a/web/js/app.js +++ b/web/js/app.js @@ -134,7 +134,15 @@ ZoneMinder.config(function($stateProvider, $urlRouterProvider) { .state('options', { abstract: true, url: '/options', - templateUrl: '/views/options/options.html' + templateUrl: '/views/options/options.html', + resolve: { + configData: function(Config) { + return Config.get(); + } + }, + controller: function($scope, configData) { + $scope.configData = configData.data.config; + } }) .state('options.images', { url: '/images',