我想在我的预引导 angular.injector 中配置 ngstorage 的前缀。
angular.element(document).ready(function () {
var
initInjector = angular.injector(['ng', 'ngStorage']),
$http = initInjector.get('$http'),
$localStorage = initInjector.get('$localStorage'),
$localStorageProvider = initInjector.get('$localStorageProvider'),
storage = $localStorage.$default({
configuration: {},
configurationExpireDate: new Date()
})
;
// initInjector.config(function () { $localStorageProvider.setKeyPrefix('CT'); }); // not working
$localStorageProvider.setKeyPrefix('CT'); // not working, too
}
因此,也许您知道如何在以编程方式引导“真实”应用程序之前配置 ngstorage 前缀。
谢谢!