Why does this AngularJs Service with variable object name return an undefined object?
问题 Scenario : I'd like to use this service to share some properties inside my webApp. This service should have some object inside and the controllers should be able to get and set those objects. JS : var oneApp = angular.module('myApp', ['ui.bootstrap', 'ngTouch', 'ngAnimate']) .service('sharedProps', function() { var anObjNameDest = ''; var anObjPropName = ''; this.progressBarDynTyped00 = { dynamic: 0, dynMultiplier: 10, max: 100 }; var progressBarDynTyped00 = { dynamic: 1000, dynMultiplier: