Adding founders world discount

This commit is contained in:
Colin McLeod
2015-06-12 23:40:32 -07:00
parent 0d09607d30
commit 5649dc9079
5 changed files with 41 additions and 15 deletions

View File

@@ -183,6 +183,27 @@ angular.module('app').service('Persist', ['$window', 'lodash', function($window,
}
};
/**
* Persist selected discount
* @param {number} val Discount value/amount
*/
this.setDiscount = function(val) {
if (this.lsEnabled) {
return localStorage.setItem('discount', val);
}
};
/**
* Get the saved discount
* @return {number} val Discount value/amount
*/
this.getDiscount = function() {
if (this.lsEnabled) {
return localStorage.getItem('discount');
}
return null;
};
/**
* Retrieve the last router state from local storage
* @param {object} state State object containing state name and params