Giter Site home page Giter Site logo

ng2-cache's People

Contributors

ctg-mmulder avatar jackson88 avatar paritosh64ce avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ng2-cache's Issues

ng2-cache support IE10 and above?

I have plan to use ng2-cache ,whether it support IE 10 and above browsers.why ng2cache data store in session storage instead of in memory?how to use it in cache memory instead of session storage.

Angular AOT/ngc support

ng2-cache does not ship with *.metadata.json files next to the *.d.ts files.
This is needed for AoT compiled apps (reference)

For now, I got the following error while ngc :

ngc -p tsconfig.ngc.json

Error: ENOENT: no such file or directory, open 'E:\tfswork\3\s\dist\module\node_modules\ng2-cache\src\interfaces\cache-options.interface.metadata.json'

Can you please check ?

Size limit

What is size limit for data stored this way?

Size issue not throwing an exception

We had an issue where a data table was increased in size, exceeding the 5Mb limit for local storage. It became a much bigger debugging and resolving issue because no exception was thrown. Reading from the cache simply returned null, which caused the main app to resort to the fallback method of reading from the API. An exception when writing more then the max limit would have been very welcome.

Default cache options

HI, first off, great package its working well good job!

I noticed your using this for Default cache options.

/** * Default cache options */ private _defaultOptions: CacheOptionsInterface = { expires: Number.MAX_VALUE, maxAge : Number.MAX_VALUE };

How long is that exactly, am i reading it right to say its indefinite until the session cache is cleared?

If so, how would you set the cache to expire to say 1 day?

Building error

ng2-cache/src/services/cache.service.ts(111,21): error TS7017: Index signature of object type implicitly has an 'any' type

Add `cacheService.get` Documentation

There is no documentation on the CacheService.get(key: string) method in the README. It would be nice to know all of the publicly available methods without having to sift through the source. There is only documentation on the use of CacheService.getTagData(tag: string).

Update for the doc

Works perfectly for me but the doc is out of date for switching to local storage on angular 2.0.
This will work with angular 2.0:
providers: [
CacheService,
{provide: CacheStorageAbstract, useClass:CacheLocalStorage }
]
Cheers

[Feature Request] Ability to get TTL

I'm playing around with Angular and your library, trying to build jira dashboard page

It has kind of paginated api to fetch issues, and it is slow, so I'm going to cache it for better user experience

In UI I wish to display "2 hours ago" data were fetched and "reload" button

But in current implementation it is not possible

It is just a ping, seems to be an easy feature, but not sure if it will fit your vision, so just trying to start conversation without any PRs

Typescript emitted no output for (...) cache-local-storage.service.ts

Hi,
using your module with webpack, ts-loader 1.3 and typescript 2.1.4:

modulesModuleBuildError: Module build failed: Error: Typescript emitted no output for node_modules\ng2-cache\src\services\storage\local-storage\cache-local-storage.service.ts. You should not need to recompile .ts files in node_modules.

Please contact the package author to advise them to use --declaration --outDir.
More microsoft/TypeScript#12358

Module not found: Error: Can't resolve 'ng2-cache/ng2-cache'

Hello All,
I am creating a custom module which contains some functionalities of centralization something that is used throughout multiple angular apps.

I am publishing this module locally including ng2-cache module.

Problem Statement: When i use ng2-cache module inside my module (i.e Core Module) and once i use this Core Module inside another app and compile, compiler throws following error

ERROR in ../app-core/dist/src/core/services/remote.service.js
Module not found: Error: Can't resolve 'ng2-cache/ng2-cache' in 'C:\Dhaval\app-core\dist\src\core\services'
@ ../app-core/dist/src/core/services/remote.service.js 13:18-48
@ ../app-core/dist/src/app.core.js
@ ./src/app-features/services/authentication/authentication.service.ts
@ ./src/app-features/app-features.module.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts`

Is it because i am importing custom module inside my on going custom module?

\node_modules\ng2-cache\ng2-cache.ts is missing from the TypeScript compilation.

Hi team,

I got problem like that.
ERROR in ./node_modules/ng2-cache/ng2-cache.ts
Module build failed: Error: C:\Users\Gildarts\Desktop\Cache\login-test\node_modules\ng2-cache\ng2-cache.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open
an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format (https://goo.gl/jB3GVv).
at AngularCompilerPlugin.getCompiledFile (C:\Users\Gildarts\Desktop\Cache\login-test\node_modules@ngtools\webpack\src\angular_compiler_plugin.js:674:23)
at plugin.done.then (C:\Users\Gildarts\Desktop\Cache\login-test\node_modules@ngtools\webpack\src\loader.js:467:39)
at
at process._tickCallback (internal/process/next_tick.js:160:7)

Module has no exported member 'provide'

Hi,

I want to use this module with local storage and not the default session storage, when I follow the instructions on the readme file - provide(CacheStorageAbstract, { useClass: CacheLocalStorage }) I get an error - "Module has no exported member 'provide'.

Is there something that i miss?

Thanks

Encountered undefined provider error after importing CacheService

Dear Team,

I see that the issue after installing importing and keep provider as CacheService in component.
Uncaught Error: Encountered undefined provider! Usually this means you have a circular dependencies (might be caused by using 'barrel' index.ts files.

Below is the error, can you please help with it?

error TS7017: Index signature of object type implicitly has an 'any' type.

node_modules/ng2-cache/src/services/cache.service.ts(111,21): error TS7017: Index signature of object type implicitly has an 'any' type.

This blocks our production build every time. I resolve it by explicitly adding : any and as any to line 106 of the cache.service.ts file. The as any is not necessary. It looks like this:

...
public getTagData(tag: string) {
        let tags = this.get(this._tagsStorageKey()) || {},
            result: any = {} as any;
        if (tags[tag]) {
...

It's a bit inefficient as I have to apply this change every time I do an npm install or yarn.

Add support of Angular 5

Angular 5 uses TypeScript 2.4.2.

Now compiler fails with error:

ERROR in ./node_modules/ng2-cache/src/services/cache.service.ts
Module build failed: Error: /work/st-cloud-one-five-zero/node_modules/ng2-cache/src/services/cache.service.ts is not part of the compilation output. Please check the other error messages for details.

To workaround this I have to add

"include": [
    "src/**/*",
    "node_modules/ng2-cache/src/**/*"
  ]

into my tsconfig.json.

Please fix error or add workaround to README.md

Error while running tests - Appropriate loader needed error for interfaces

Hi Jackson,

I'm getting this error - "you may need appropriate loader for this file", for all files included in the package.
Just curious, is there any reason for adding source js files into this package? As far as I know, we could see only .ts files on packages right? please correct me if am wrong!

Thanks,
Hari

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.