Skip to content

Commit 4065401

Browse files
committed
Backward compatibility for getting all variables through
1 parent dad9db9 commit 4065401

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

demo/app.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,5 @@ angular.module('acme', ['environment']).
3838
}).
3939
controller('Pages', ['$scope', 'envService', function($scope, envService) {
4040
$scope.environment = envService.get(); // store the current environment
41+
$scope.vars = envService.read();
4142
}]);

src/angular-environment.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ angular.module('environment', []).
6767
* @return {Void}
6868
*/
6969
this.read = function(variable) {
70-
if (typeof variable === 'undefined' || variable === '') {
70+
if (typeof variable === 'undefined' || variable === '' || variable === 'all') {
7171
return this.data.vars[this.get()];
7272
}
7373
else if (typeof this.data.vars[this.get()][variable] === 'undefined') {

0 commit comments

Comments
 (0)