angular 中 cacheFactory 数据传递

angular 中 



app.controller('controller01',['$scope','$cacheFactory',function($scope,$cacheFactory){
	var cache = $cacheFactory('cache01');
	cache.put('name','sdsadas');
	cache.put('sdsadas','sdsadas');
	var name = cache.info();
	console.log(name);

}]);

app.controller('controller02',['$scope','$cacheFactory',function($scope,$cacheFactory){
	var cache = $cacheFactory.get('cache01');
	var name = cache.get('name');
	console.log(name);
}]);


上一篇:AngularJS 使用$sce控制代码安全检查


下一篇:Angular Route数据结构里常用字段使用方法一览