marcj / angular2-localstorage

Angular 2+ decorator to save and restore variables/class properties to HTML5 LocalStorage automatically.
302 stars 108 forks source link

Angular 2 Final - has no exported member 'provide' or 'Type' #66

Open blubberbo opened 7 years ago

blubberbo commented 7 years ago

I am running the Angular 2 Final release ^2.0.2 and angular2-localstorage is giving the following errors in the file "LocalStorageEmitter.ts":

"/node_modules/@angular/core/src/facade/lang" has no exported member 'Type' "/node_modules/@angular/core/src/di" has no exported member 'provide'

I just installed angular2-localstorage from npm, so I have latest.

Any experiencing the same issue?

Thanks

fivepapertigers commented 7 years ago

+1

radarsu commented 7 years ago

Same error.

qvantor commented 7 years ago

I got same error

daveksb commented 7 years ago

I found the same error too.

qvantor commented 7 years ago

https://github.com/btroncone/ngrx-store-localstorage this is better

woutrbe commented 7 years ago

I've gotten the same issue when following the basic instructions, is there any fix in sight for Angular 2 Final?

radarsu commented 7 years ago

You can try to use https://github.com/radarsu/angular2-localstorage. I fixed some minor issues there.

marcj commented 7 years ago

Merged angular-2.0.0 fixes. Please try again with master version.

hsaklecha commented 7 years ago

Getting this now, when i started using it : I am using latest version for angular and other dependencies

ERROR in [default] c:\Repository\xyz\node_modules\angular2-localstorage\LocalStorageEmitter.ts:46:8 Module '"c:/Repository/xyz/node_modules/@angular/core/src/facade/lang"' has no exported member 'Type'.

ERROR in [default] c:\Repository\xyz\node_modules\angular2-localstorage\LocalStorageEmitter.ts:47:8 Module '"c:/Repository/xyz/node_modules/@angular/core/src/di"' has no exported member 'provide'.

ERROR in [default] c:\Repository\xyz\src\app\app.module.ts:3:54 Cannot find module 'angular2-localstorage'.

hsaklecha commented 7 years ago

Is this issue resolved, i am still getting error

mdopieralski commented 7 years ago

angular 2.4.6 x angular2-localstorage 0.4.0 => still occuring

jelling commented 7 years ago

+1

SuTran commented 7 years ago

+1

DanielKucal commented 7 years ago

My fork of angular2-localstorage works pretty well with newest Angular2 version and has some extra features (with no breaking changes) listed in README. Hope you'll enjoy it :)

venikx commented 7 years ago

@hsaklecha @mdopieralski @jelling @SuTran This is probably, because you are installing this library using npm, for whatever reason the github version and npm version seem out-of-sync.

chopada commented 7 years ago

Replace this lines from "LocalStorageEmitter.ts" from node_modeule "angular2-localstorage"

import {Type} from "@angular/core/src/facade/lang";
import {provide} from "@angular/core/src/di";
import {ComponentRef} from "@angular/core";

export function LocalStorageSubscriber(appPromise: Promise<ComponentRef<any>>) {
    appPromise.then((bla) => {
        bla.injector.get(<Type>LocalStorageService);
    });
}

with this.

import {Type} from "@angular/core/src/type";
import {Provider} from "@angular/core/src/di";
import {ComponentRef} from "@angular/core";

export function LocalStorageSubscriber(appPromise: Promise<ComponentRef<any>>) {
    appPromise.then((bla) => {
        bla.injector.get(<Type<any>>LocalStorageService);
    });
}

It's Works for me...

fToledo29 commented 7 years ago

Thanks @chopada , it works for me.

YannikHsKA commented 7 years ago

Thanks @chopada , worked for me as well.