4 ms·
Has anyone had success using the AOT tools to build a package of reusable angular components? I was able to use AOT pretty easily for a stand-alone app, but kee
by hanspragt 9y ago
Has anyone had success using the AOT tools to build a package of reusable angular components? I was able to use AOT pretty easily for a stand-alone app, but keep running into issues when trying to create a shareable component, and there is not a lot of documentation around this.
- rickcnagy 9y agoI have for my day job, but it's _hard_. There isn't a lot of good info out there. Here are a few good sources that I found helpful: https://medium.com/@isaacplmann/getting-your-angular-2-library-ready-for-aot-90d1347bcad https://medium.com/@isaacplmann/getting-your-angular-2-libra... http://dbarnes.me/writing-an-aot-compliant-angular-library/ http://dbarnes.me/writing-an-aot-compliant-angular-library/ https://angular.io/guide/aot-compiler https://angular.io/guide/aot-compiler https://angular.io/guide/metadata https://angular.io/guide/metadata
- tashoecraft 9y agoYes, but it can be terrible. Suggestion is to take one of the angular library generators. They really need proper docs on how to set this up properly.
- harunurhan 9y agoI have, but by using ngc in my gulp build task (had to use gulp for the reason below), unfortunately couldn't make it incremental at that time, so it takes several seconds to re-build when the source is changed. There is actually another problem when you want to develop reusable UI component library project is that you have to inline style files and template file into ts component.
- hanspragt 9y ago> There is actually another problem when you want to develop reusable UI component library project is that you have to inline style files and template file into ts component. We have a webpack-based process, and using the angular2-template-loader will take care of this for you. Unfortunately, webpack and aot don't mix well.