angular2-localstorage icon indicating copy to clipboard operation
angular2-localstorage copied to clipboard

Issues with Ionic

Open Renader opened this issue 9 years ago • 5 comments

If i inject the LocalStorageService from import {LocalStorageService} from "angular2-localstorage/LocalStorageEmitter";

i receive


/project $ ionic serve

Running 'serve:before' gulp task before serve
[09:35:56] Starting 'clean'...
[09:35:56] Finished 'clean' after 12 ms
[09:35:56] Starting 'watch'...
[09:35:56] Starting 'sass'...
[09:35:56] Starting 'html'...
[09:35:56] Starting 'fonts'...
[09:35:56] Starting 'scripts'...
[09:35:56] Finished 'scripts' after 26 ms
[09:35:56] Finished 'html' after 33 ms
[09:35:56] Finished 'fonts' after 33 ms
[09:35:56] Finished 'sass' after 619 ms

/project/node_modules/angular2-localstorage/LocalStorageEmitter.ts:1
import {Injectable, OnDestroy} from "@angular/core";
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

Renader avatar Jun 10 '16 07:06 Renader

You should post issues with Ionic in the ionic repo. This library is a regular Typescript library, you need to include in your build routine. I have no idea about Ionic's typescript use.

marcj avatar Jun 13 '16 13:06 marcj

hey @marcj thanks for your response. Sorry my typescript skills are limited. Can't i now just use npm install and then use import {LocalStorageService} from "angular2-localstorage/LocalStorageEmitter"; ?

Angular2-localstorage is the best implementation i found for ng2. But noobs as me need to get it up and running u knwo? :)

Renader avatar Jun 14 '16 15:06 Renader

Got the same issue here. I guess it's because the gulp toolchain is not transpiling node modules. At the moment, I just took the source files (.ts) in my own project folder...

VinceOPS avatar Jun 20 '16 12:06 VinceOPS

@Renader @VinceOPS have you fixed your problem? I'm also getting the ParseError

iamdevlinph avatar Aug 08 '16 17:08 iamdevlinph

Me too..any update?

jeffthompson1971 avatar Sep 15 '16 06:09 jeffthompson1971