diff --git a/js/angular/controller/spinnerController.js b/js/angular/controller/spinnerController.js index 13be7ee4145..03a2bded3b0 100644 --- a/js/angular/controller/spinnerController.js +++ b/js/angular/controller/spinnerController.js @@ -390,20 +390,12 @@ .controller('$ionicSpinner', [ '$element', '$attrs', - function($element, $attrs) { - var spinnerName, spinner; + '$ionicConfig', + function($element, $attrs, $ionicConfig) { + var spinnerName; this.init = function() { - var override = null; - if (ionic.Platform.platform() === 'windowsphone') { - override = 'android'; - } - spinnerName = $attrs.icon || override || ionic.Platform.platform(); - spinner = spinners[spinnerName]; - if (!spinner) { - spinnerName = 'ios'; - spinner = spinners.ios; - } + spinnerName = $attrs.icon || $ionicConfig.spinner.icon(); var container = document.createElement('div'); createSvgElement('svg', { diff --git a/js/angular/service/ionicConfig.js b/js/angular/service/ionicConfig.js index 8a0f07718dd..3c172a4a834 100644 --- a/js/angular/service/ionicConfig.js +++ b/js/angular/service/ionicConfig.js @@ -138,6 +138,14 @@ * @returns {string} */ +/** + * @ngdoc method + * @name $ionicConfigProvider#spinner.icon + * @description Spinner icon. + * @param {string} value + * @returns {string} + */ + /** * @ngdoc method * @name $ionicConfigProvider#tabs.style @@ -253,6 +261,9 @@ IonicModule scrolling: { jsScrolling: PLATFORM }, + spinner: { + icon: PLATFORM + }, tabs: { style: PLATFORM, position: PLATFORM @@ -300,6 +311,10 @@ IonicModule jsScrolling: true }, + spinner: { + icon: 'ios' + }, + tabs: { style: 'standard', position: 'bottom' @@ -345,6 +360,10 @@ IonicModule toggle: 'small' }, + spinner: { + icon: 'android' + }, + tabs: { style: 'striped', position: 'top' @@ -358,6 +377,9 @@ IonicModule //scrolling: { // jsScrolling: false //} + spinner: { + icon: 'android' + } }); diff --git a/test/html/spinners.html b/test/html/spinners.html index bbdad24e604..f376070759c 100644 --- a/test/html/spinners.html +++ b/test/html/spinners.html @@ -1,5 +1,5 @@ - +