[AOT] build fails due to private classList in FaComponent and private members in FaDirective
pachuka opened this issue · 8 comments
Hi,
In angular2-fontawesome 0.8.0 with Angular 2.4.1., the AOT build fails for me due to the following:
fa.component.ts template refers to classList variable which is private, needs to be public for AOT to work.
fa.directive.ts private member variables name -> inverse all also need to be public for AOT to work.
Thanks,
Piyush
Upgrade to 0.9.0. AOT will work now. At least, it does for me in Angular 4.
It is not a question of the angular version but of the angularCLI version. Did you test it with angular CLI 1.0.0 (no RC)? For me, it still doesn't work with angular2-fontawesome 0.9.0:
ERROR in D:/Projects/Simple DMS/src/source/SD.Clients.Web/src/$$_gendir/node_modules/angular2-fontawesome/src/fa.directive.ngfactory.ts (51,20): Property 'name' is private and only ac
cessible within class 'FaDirective'.
D:/Projects/Simple DMS/src/source/SD.Clients.Web/src/$$_gendir/node_modules/angular2-fontawesome/src/fa.directive.ngfactory.ts (59,20): Property 'alt' is private and only accessible w
ithin class 'FaDirective'.
D:/Projects/Simple DMS/src/source/SD.Clients.Web/src/$$_gendir/node_modules/angular2-fontawesome/src/fa.directive.ngfactory.ts (67,20): Property 'size' is private and only accessible
within class 'FaDirective'.
D:/Projects/Simple DMS/src/source/SD.Clients.Web/src/$$_gendir/node_modules/angular2-fontawesome/src/fa.directive.ngfactory.ts (75,20): Property 'stack' is private and only accessible
within class 'FaDirective'.
D:/Projects/Simple DMS/src/source/SD.Clients.Web/src/$$_gendir/node_modules/angular2-fontawesome/src/fa.directive.ngfactory.ts (83,20): Property 'flip' is private and only accessible
within class 'FaDirective'.
D:/Projects/Simple DMS/src/source/SD.Clients.Web/src/$$_gendir/node_modules/angular2-fontawesome/src/fa.directive.ngfactory.ts (91,20): Property 'pull' is private and only accessible
within class 'FaDirective'.
D:/Projects/Simple DMS/src/source/SD.Clients.Web/src/$$_gendir/node_modules/angular2-fontawesome/src/fa.directive.ngfactory.ts (99,20): Property 'rotate' is private and only accessibl
e within class 'FaDirective'.
D:/Projects/Simple DMS/src/source/SD.Clients.Web/src/$$_gendir/node_modules/angular2-fontawesome/src/fa.directive.ngfactory.ts (107,20): Property 'border' is private and only accessib
le within class 'FaDirective'.
D:/Projects/Simple DMS/src/source/SD.Clients.Web/src/$$_gendir/node_modules/angular2-fontawesome/src/fa.directive.ngfactory.ts (115,20): Property 'spin' is private and only accessible
within class 'FaDirective'.
D:/Projects/Simple DMS/src/source/SD.Clients.Web/src/$$_gendir/node_modules/angular2-fontawesome/src/fa.directive.ngfactory.ts (123,20): Property 'fw' is private and only accessible w
ithin class 'FaDirective'.
D:/Projects/Simple DMS/src/source/SD.Clients.Web/src/$$_gendir/node_modules/angular2-fontawesome/src/fa.directive.ngfactory.ts (131,20): Property 'inverse' is private and only accessi
ble within class 'FaDirective'.
I used @angular/cli 1.0.0 and angular2-fontawesome 0.9.0
I also used the following command to build: ng build --prod --aot
I had no errors or warnings. Everything builds just fine.
Yes. This is how I used it: <i fa [name]="'check'">
Edit: That's odd. It doesn't show the closing element in this editor.
Did you type: "npm install" after you changed the version to 0.9.0 in package.json?
Sure.
D:\Projects\Simple DMS\src\source\SD.Clients.Web>npm list angular2-fontawesome
simple-dms-web-client@0.0.0 D:\Projects\Simple DMS\src\source\SD.Clients.Web
+-- UNMET PEER DEPENDENCY @angular/compiler@2.4.10
+-- UNMET PEER DEPENDENCY @angular/forms@2.4.10
`-- angular2-fontawesome@0.9.0
I am still in a Angular2 project. Maybe it does make a difference after all. Couldn't test with Angular 4 because it's not working for me: angular/angular-cli#4551 (comment)
Sorry for my delayed reply. We are not using angular-cli at all, but I just tested with version 0.9.0 with Angular 4 and AOT builds fine for us now. Thanks!