Skip to content

Commit

Permalink
Backward compatibility for getting all variables through
Browse files Browse the repository at this point in the history
  • Loading branch information
juanpablob committed Apr 23, 2017
1 parent dad9db9 commit 4065401
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions demo/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ angular.module('acme', ['environment']).
}).
controller('Pages', ['$scope', 'envService', function($scope, envService) {
$scope.environment = envService.get(); // store the current environment
$scope.vars = envService.read();
}]);
2 changes: 1 addition & 1 deletion src/angular-environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ angular.module('environment', []).
* @return {Void}
*/
this.read = function(variable) {
if (typeof variable === 'undefined' || variable === '') {
if (typeof variable === 'undefined' || variable === '' || variable === 'all') {
return this.data.vars[this.get()];
}
else if (typeof this.data.vars[this.get()][variable] === 'undefined') {
Expand Down

0 comments on commit 4065401

Please sign in to comment.