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

Unable to implement in ionic 2 project #33

Closed
MatanYadaev opened this issue Apr 29, 2016 · 10 comments
Closed

Unable to implement in ionic 2 project #33

MatanYadaev opened this issue Apr 29, 2016 · 10 comments

Comments

@MatanYadaev
Copy link

try it, it's makes alot of errors.
ionic 2 beta 6

if you success please tell me the steps to implement.

@danielgolub
Copy link

+1

@mauricionarcizo
Copy link

mauricionarcizo commented May 12, 2016

I'm using angular2-moment in my projeto ionic with success.
Steps to use:

npm install angular2-moment -> version 0.5.0 is compatible with ionic-angular beta 6

In my page/component declare the pipes, like this:

import {TimeAgoPipe} from 'angular2-moment/TimeAgoPipe.js';

@component({
pipes:[TimeAgoPipe]
})

In my Html:

{{lastSync | amTimeAgo}}

@elineopsommer
Copy link

I followed the steps described by @mauricionarcizo , but i keep getting this error:
/Users/Eline/Documents/Stack & Heap/project kvk app/kvkapp/node_modules/angular2-moment/TimeAgoPipe.ts:3 import {Pipe, ChangeDetectorRef, PipeTransform, OnDestroy} from 'angular2/core'; ^ ParseError: 'import' and 'export' may appear only with 'sourceType: module'

@urish
Copy link
Owner

urish commented May 22, 2016

Should be fixed by 0.8.0. Just upgrade to latest angular2-moment and import it like this:

import {TimeAgoPipe} from 'angular2-moment';

@urish urish closed this as completed May 22, 2016
@elineopsommer
Copy link

elineopsommer commented May 23, 2016

This is not working for me.
i'm using:
"angular2": "2.0.0-beta.15", "angular2-moment": "^0.8.0", "ionic-angular": "2.0.0-beta.6",
I'm not getting the error anymore, but it also doesn't work.

@urish
Copy link
Owner

urish commented May 23, 2016

What does your import statement look like?
On May 23, 2016 12:35 AM, "eevine" notifications@github.com wrote:

This is not working for me.
i'm using:
"angular2": "2.0.0-beta.15",
"angular2-moment": "^0.8.0",
"ionic-angular": "2.0.0-beta.6",


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#33 (comment)

@elineopsommer
Copy link

The same like you said: import {TimeAgoPipe} from 'angular2-moment';

@urish
Copy link
Owner

urish commented May 23, 2016

And which error do you get?
On May 23, 2016 1:34 AM, "eevine" notifications@github.com wrote:

The same like you said: import {TimeAgoPipe} from 'angular2-moment';


You are receiving this because you modified the open/close state.
Reply to this email directly or view it on GitHub
#33 (comment)

@elineopsommer
Copy link

I get no errors anymore with the 0.8.0 version, but it also doesn't go to the page where I used the pipe in the html. I'll make a plunker.

@elineopsommer
Copy link

It works now, no clue why, I did everything again and now it works. Thanks.

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

5 participants