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

importing DomStorageStrategy #52

Closed
robert-king opened this issue Oct 22, 2019 · 2 comments
Closed

importing DomStorageStrategy #52

robert-king opened this issue Oct 22, 2019 · 2 comments

Comments

@robert-king
Copy link

I can't seem to import DomStorageStrategy, perhaps it's not exported?


import { Cacheable } from 'ngx-cacheable';
import { DOMStorageStrategy } from '@ngx-cacheable/common/DOMStorageStrategy';


@Injectable({
  providedIn: 'root'
})
export class UserService {
  private user$: Observable<UserDetailsViewModel> = null;

  constructor(
    private userDetailService: UserDetailService,
    private showErrorService: ShowErrorService,
  ) {}

  @Cacheable({
    maxAge: 1000 * 60 * 60 * 24,
    storageStrategy: DOMStorageStrategy,
  })
  public getAvatar(): Observable<string> {
    return this.userDetailService.UserDetailGetUserAvatar();
  }

I get an error:


Failed to compile.

./src/app/some-services/user.service.ts
Module not found: Error: Can't resolve '@ngx-cacheable/common/DOMStorageStrategy' in '/Users/robertking/go/src/bitbucket.org/borndigital-nz/barker.mybarker/front-end/src/app/some-services'

@angelnikolov
Copy link
Owner

angelnikolov commented Oct 22, 2019

@robert-king The import should be import { DOMStorageStrategy } from 'ngx-cacheable/common/DOMStorageStrategy';
Let's leave this issue up until I fix that in the README :)

@angelnikolov
Copy link
Owner

README updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants