Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set global cache defaults in $angularCacheFactoryProvider #55

Closed
jmdobry opened this issue Sep 22, 2013 · 0 comments
Closed
Assignees
Milestone

Comments

@jmdobry
Copy link
Owner

jmdobry commented Sep 22, 2013

In an app module's config() method where service providers are configured, add the ability to configure the $angularCacheFactoryProvider. The first configuration option that will be available will be the ability to configure global defaults for all caches produced by $angularCacheFactory. For example: if I want all of my caches to have a capacity of 1000, I could do:

app.module('myApp', ['jmdobry.angular-cache'])
    .config(function ($angularCacheFactoryProvider) {
        $angularCacheFactoryProvider.setCacheDefaults({
            capacity: 1000
        });
    })
    .run(function ($angularCacheFactory) {
        $angularCacheFactory('newCache').info().capacity; // 1000
    });
@ghost ghost assigned jmdobry Sep 22, 2013
@jmdobry jmdobry mentioned this issue Sep 22, 2013
14 tasks
@jmdobry jmdobry closed this as completed Sep 23, 2013
jmdobry added a commit that referenced this issue Sep 24, 2013
Swapped `localStorageImpl` and `sessionStorageImpl` options for just `storageImpl` option.
@jmdobry jmdobry mentioned this issue Oct 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant