Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ICacheObject

$cacheFactory.Cache - type in module ng

A cache object used to store and retrieve data, primarily used by $http and the script directive to cache templates and other data.

see https://docs.angularjs.org/api/ng/type/$cacheFactory.Cache

Hierarchy

Index

Methods

destroy

  • destroy(): void
  • Destroys the Cache object entirely, removing it from the $cacheFactory set.

    Returns void

get

  • get<T>(key: string): T
  • Retrieves named data stored in the Cache object.

    Type parameters

    • T

    Parameters

    • key: string

      the key of the data to be retrieved

    Returns T

info

  • info(): object
  • Retrieve information regarding a particular Cache.

    Returns object

    • id: string

      the id of the cache instance

    • size: number

      the number of entries kept in the cache instance

put

  • put<T>(key: string, value?: T): T
  • Inserts a named entry into the Cache object to be retrieved later, and incrementing the size of the cache if the key was not already present in the cache. If behaving like an LRU cache, it will also remove stale entries from the set.

    It will not insert undefined values into the cache.

    Type parameters

    • T

    Parameters

    • key: string

      the key under which the cached data is stored.

    • Optional value: T

      the value to store alongside the key. If it is undefined, the key will not be stored.

    Returns T

remove

  • remove(key: string): void
  • Removes an entry from the Cache object.

    Parameters

    • key: string

      the key of the entry to be removed

    Returns void

removeAll

  • removeAll(): void
  • Clears the cache object of any entries.

    Returns void

Generated using TypeDoc