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

[AOT] build fails due to private classList in FaComponent and private members in FaDirective #28

Closed
pachuka opened this issue Mar 3, 2017 · 8 comments · May be fixed by #32
Closed

Comments

@pachuka
Copy link

pachuka commented Mar 3, 2017

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

@DannyBoyNg
Copy link

Upgrade to 0.9.0. AOT will work now. At least, it does for me in Angular 4.

@dhilgarth
Copy link

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'.

dhilgarth pushed a commit to dhilgarth/angular2-fontawesome that referenced this issue Apr 11, 2017
@DannyBoyNg
Copy link

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.

@dhilgarth
Copy link

dhilgarth commented Apr 11, 2017 via email

@DannyBoyNg
Copy link

DannyBoyNg commented Apr 11, 2017

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.

@DannyBoyNg
Copy link

Did you type: "npm install" after you changed the version to 0.9.0 in package.json?

@dhilgarth
Copy link

Sure.

D:\Projects\Simple DMS\src\source\SD.Clients.Web>npm list angular2-fontawesome
[email protected] D:\Projects\Simple DMS\src\source\SD.Clients.Web
+-- UNMET PEER DEPENDENCY @angular/[email protected]
+-- UNMET PEER DEPENDENCY @angular/[email protected]
`-- [email protected]

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)

@pachuka
Copy link
Author

pachuka commented Apr 11, 2017

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!

@pachuka pachuka closed this as completed Apr 11, 2017
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.

3 participants