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

ng2-charts does not work with Angular 2.beta12 (due to @View()) #100

Closed
jgenchik opened this issue Mar 24, 2016 · 15 comments · Fixed by #132
Closed

ng2-charts does not work with Angular 2.beta12 (due to @View()) #100

jgenchik opened this issue Mar 24, 2016 · 15 comments · Fixed by #132

Comments

@jgenchik
Copy link

It seems that in beta 12 Google removed @view directive from angular2/core. When I run TypeScript transpiler, it generates an error.

Unable to compile TypeScript
node_modules\ng2-charts\components\charts\charts.ts (2,14): Module '"C:...node_modules/angular2/core"' has no exported member 'View'.
2305)

@jgenchik jgenchik changed the title ng-charts does not work with Angular 2.beta12 (due to @View()) ng2-charts does not work with Angular 2.beta12 (due to @View()) Mar 24, 2016
@jgenchik
Copy link
Author

So I see that an hour before I submitted this issue, ng2-charts was changed and all reverences to @view were removed. I downloaded the new version, via npm install https://github.com/valor-software/ng2-charts.git --save but it seems that it only contains TypeScript. When I go to run my application, an ng2-charts**.js** is not found. Any suggestions on how to proceed?

@valorkin
Copy link
Member

it depends on how are you consuming ng2-charts
webpack? system.js?
and small hint npm install -S valor-software/ng2-charts :)

@jgenchik
Copy link
Author

I am using system.js but it probably be helpful to know how to use both, system.js and webpack

@valorkin
Copy link
Member

the things is, you can sonsume .js or .ts
for system.js you will need to configure typescript builder

@jgenchik
Copy link
Author

This is what my modified system.config looks like:
System.config({
"defaultJSExtensions": true,
"packageConfigPaths": [
"/node_modules//package.json"
],
"paths": {
"main": "/main",
"angular2/
": "/angular2/",
"rxjs/
": "/rxjs/",
"moment/
": "/node_modules/moment/moment",
"": "/node_modules/",
"angular2-jwt": "/node_modules/angular2-jwt/angular2-jwt",
"ng2-charts": "/node_modules/ng2-charts"
},
"packages": {
"angular2": {
"defaultExtension": false
},
"rxjs": {
"defaultExtension": false
},
"ng2-charts": {
"defaultExtension": false
}

}
})

Yet, I am still getting an error

localhost/:105 Error: SyntaxError: Unexpected token <
        at Object.eval .........
    Evaluating http://localhost:5555/node_modules/ng2-charts/ng2-charts
    ......
"Report this error at https://github.com/mgechev/angular2-seed/issues"

@devangvt
Copy link

devangvt commented Apr 1, 2016

I am getting the same error @jgenchik did you solve it?
@valorkin any fix for this yet?

@valorkin
Copy link
Member

valorkin commented Apr 1, 2016

@devangvt I have just updated ng2-bootstrap to beta.12
now I will update it to 13 and will be updating all other modules
sorry for so long waiting time

@ksteigerwald
Copy link

/node_modules/ng2-charts/components/charts/charts.ts (2, 14): Module '"/node_modules/angular2/core"' has no exported mng 'View'.

Just updated to beta.13, running into what appears to be the same or similar problem.

@jgenchik
Copy link
Author

jgenchik commented Apr 6, 2016

@devangvt no, I didn't solve it. I just stopped using ng2-charts.

@luchillo17
Copy link

Same issue here with ng2-charts 1.0.0-beta.0 and angular2.0.0-beta.14, i will have to install from repository, there's a commit to fix this just that isn't released to npm yet: Remove Reference to 'View'

@valorkin I didn't know it was so easy to install from repo, i always tough i had to use the git url, thanks: #100 (comment)

@luchillo17
Copy link

Ok using npm package from git repo now shows in webpack error TS2307: Cannot find module 'ng2-charts'., any idea why?

@zackarychapple
Copy link
Contributor

Can this get bumped to beta 14 and have a tag cut please. Trying to use this.

@luchillo17
Copy link

@valorkin do you know how to npm install from the dev branch? i would like to test this to see if this fixes some issues i have with the beta.0 release.

@zackarychapple
Copy link
Contributor

@Luchillo npm install git://github.com/valor-software/ng2-charts.git#development --save should work

@valorkin
Copy link
Member

@zackarychapple it is published to npm
@Luchillo so you can install it from there

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

Successfully merging a pull request may close this issue.

6 participants