Comments (6)
https://medium.com/@isaacplmann/getting-your-angular-2-library-ready-for-aot-90d1347bcad
Something along those lines needs to happen I suppose?
from angular2-nvd3.
That sounds about right I think, at least the error matches. Just in case someone wants a quick temporary fix, I got this to work with AoT with a workaround by copying the components to my own project instead of using the module.
from angular2-nvd3.
I was giving it a shot earlier today but I couldn't get ngc
to emit .metadata.json
files as the article suggests. The whole Angular 2 toolchain is rather befuddling to me.
Maybe I'll try again once I get some free time. Until then, this library is sort of unusable in conjunction with Angular CLI. Any workarounds?
from angular2-nvd3.
Copy all four files from /src/angular2-nvd3 into your own project and replace the "ngOnChanges()" methods with "ngOnChanges(changes?)". Then you can just import the module into your app.module.ts and the component where you want to use the selector, works with AoT.
import { NvD3Module } from '../nvd3/angular2-nvd3.module';
declare var d3: any;
@Component({
selector: 'app-timeframebarchart',
template: '<app-nvd3 [options]="options" [data]="data"></app-nvd3>'
})
Of course you also still need to include the separately downloadable nv.d3.css in your project for the styles to be right.
from angular2-nvd3.
@ekuusi I had some success in getting this package ready for AOT by changing the tsconfig.json
to include "angularCompilerOptions": { "strictMetadataEmit": true }
and compile ngc
instead of tsc
in the package.json
.
This requires that you install @angular/compiler-cli
as a dev dependency. ngc
then emits the necessary .metadata.json
files for AOT. I'll look at creating a pull request later. For now I have published an npm package that works for me (i.e. https://www.npmjs.com/package/angular2-nvd3-aot).
from angular2-nvd3.
I close this issue, since I accept Ready for AOT #10
from angular2-nvd3.
Related Issues (13)
- ERROR in NvD3Module is not an NgModule HOT 5
- Interface D3/nvD3 HOT 1
- Problem with @types/nvd3 package HOT 2
- ERROR in NvD3Module is not an NgModule HOT 5
- Document a little bit more the chart "options" HOT 1
- ngOnChanges missing input argument HOT 1
- Access to the chart object
- iOS: MouseOver triggered instead of elementClick and chartClick
- Uncaught Error: Template parse errors: Can't bind to 'options' since it isn't a known property of 'nvd3'.
- How to access the chart object and update HOT 1
- Export update methods
- For line chart inconsistent dates observed on x-axis
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular2-nvd3.