angular 如何处理缓存

angularjs 如何处理缓冲(cache)

这应该是一个必备技能,但是其实我对angular真正上手比较晚,所以对angular的缓存机制并不是很了解;

废话不多少 还上班呢 直接上代码
其他的还需要自己脑补
、、、、、
angular.module('app').service('cache', ['$cookies', function($cookies){
    this.put = function(key, value){
      $cookies.put(key, value);
    };
    this.get = function(key) {
      return $cookies.get(key);
    };
    this.remove = function(key) {
      $cookies.remove(key);
    };
}]);

版权声明:本文为lning52yx原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。