leonardosalles / ionic2-zoom-area

A zoom area component with pinch support
MIT License
33 stars 13 forks source link

Cannot compile with Ionic 3 #10

Closed rbaumi closed 6 years ago

rbaumi commented 6 years ago

I'm currently using Ionic v 3.9.2. The component works as expected but when I try to compile it I get an error:

Error during template compile of 'ZoomAreaModule' Function calls are not supported in decorators in 'NgModule'

Heve anyone tried to compile the app using Ionic 3?

leonardosalles commented 6 years ago

What you want to say with 'compile'? Are you talking about prod and release?

ionic cordova build android --prod --release?

rbaumi commented 6 years ago

Only prod:

ionic cordova build android --prod

Removing ZoomAreaModule removes the problem. I have imported it in identical way as in your instructions so there is no need for copy / paste of thge code. Have you tried that with newest version of angular and ionic?

    "@angular/animations": "^5.1.1",
    "@angular/common": "^5.1.1",
    "@angular/compiler": "^5.1.1",
    "@angular/compiler-cli": "^5.1.1",
    "@angular/core": "^5.1.1",
    "@angular/forms": "^5.1.1",
    "@angular/http": "^5.1.1",
    "@angular/platform-browser": "^5.1.1",
    "@angular/platform-browser-dynamic": "^5.1.1",
    "ionic-angular": "3.9.2",

I'm using AoT compilation if this helps.

leonardosalles commented 6 years ago

Will investigate, it is not tested with AoT.

RHinderiks commented 6 years ago

Any news on this. This seems to be the only working way to zoom in ionic. Would love to use it in ionic 3

sharutza commented 6 years ago

Is it working with Ionic 3? I'm getting :"Uncaught (in promise): Error: Template parse errors: 'zoom-area' is not a known element"

RHinderiks commented 6 years ago

@sharutza Don't think so

leonardosalles commented 6 years ago

It works in Ionic 3, you need to check the example project ;)

At this moment some users reported problems after build for production but it is a little hard to track, I tried many versions of Ionic 3 and all version worked properly for me.

leonardosalles commented 6 years ago

@sharutza check the module where you are declaring the zoom area module, it seems to be a module injection error with Lazy Loading, learn it well first before commenting.

danersan commented 6 years ago

got same problem with @sharutza and im already following all steps, including module injection

RHinderiks commented 6 years ago

@leonardosalles sorry about that. i saw this git issue without an answer so assumed it was still valid. Will try it later

danersan commented 6 years ago

dang, suddenly it works for me, dont know why and how im just rerun ionic serve and change my code a little bit but it kind of ruined my other element

teshtek commented 6 years ago

I have the same problem. With IONIC SERVE it works.Perfect, but when I want to put it on mobile (run this : ionic cordova run android --prod --optimizejs --minifycss --minifyjs so --prod) I have this error [00:40:41] typescript error Error during template compile of 'ZoomAreaModule' Function calls are not supported in decorators in 'NgModule' 'NgModule' calls a function at @angular\core\core.ts(194,31).

Any solution?

leonardosalles commented 6 years ago

Sorry for delay, I am working on that.

leonardosalles commented 6 years ago

Fixed in 1.0.16 - Please update npm package to latest version. Example app was updated too.

ZeroQool007 commented 6 years ago

Same issue