From f12965dd6b0a65cf2cf1b7c228fc5986dd5e9f4a Mon Sep 17 00:00:00 2001 From: MaysWind Date: Mon, 23 May 2016 22:56:39 +0800 Subject: [PATCH] refactor code --- app/index.html | 1 + app/scripts/controllers/settings-ariang.js | 3 ++- app/scripts/langs/config.js | 12 ++++++++++++ app/views/settings-ariang.html | 6 +++--- 4 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 app/scripts/langs/config.js diff --git a/app/index.html b/app/index.html index fedc6e2..763afb5 100644 --- a/app/index.html +++ b/app/index.html @@ -242,6 +242,7 @@ + diff --git a/app/scripts/controllers/settings-ariang.js b/app/scripts/controllers/settings-ariang.js index a755dc0..9cc7dcb 100644 --- a/app/scripts/controllers/settings-ariang.js +++ b/app/scripts/controllers/settings-ariang.js @@ -1,7 +1,8 @@ (function () { 'use strict'; - angular.module('ariaNg').controller('AriaNgSettingsController', ['$scope', 'SweetAlert', 'ariaNgSettingService', function ($scope, SweetAlert, ariaNgSettingService) { + angular.module('ariaNg').controller('AriaNgSettingsController', ['$scope', 'ariaNgLanguages', 'ariaNgSettingService', function ($scope, ariaNgLanguages, ariaNgSettingService) { + $scope.languages = ariaNgLanguages; $scope.settings = ariaNgSettingService.getAllOptions(); $scope.settingService = ariaNgSettingService; }]); diff --git a/app/scripts/langs/config.js b/app/scripts/langs/config.js new file mode 100644 index 0000000..9ef67ed --- /dev/null +++ b/app/scripts/langs/config.js @@ -0,0 +1,12 @@ +(function () { + 'use strict'; + + angular.module('ariaNg').constant('ariaNgLanguages', { + 'en-US': { + name: 'English' + }, + 'zh-CN': { + name: 'Simplified Chinese' + } + }); +})(); diff --git a/app/views/settings-ariang.html b/app/views/settings-ariang.html index 2f088d2..6327fb8 100644 --- a/app/views/settings-ariang.html +++ b/app/views/settings-ariang.html @@ -5,9 +5,9 @@ Language
-