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

0.2.0 overwrites class on fa-layers component #98

Closed
ghost opened this issue Sep 23, 2018 · 2 comments
Closed

0.2.0 overwrites class on fa-layers component #98

ghost opened this issue Sep 23, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Sep 23, 2018

Describe the problem

Prior to 0.2.0 any classes on fa-layers were preserved. Now they are overwritten.

What did you expect?

Classes should not be overwritten.

Reproducible test case

https://stackblitz.com/edit/angular-z8v4ux-vvutjk

@toverux
Copy link

toverux commented Sep 25, 2018

Yes! Same problem here.

FaLayersComponent has a HostBinding on class, and this takes control of the whole className string. Angular does not give different context to the components that are interested in the property.

This is discussed in angular/angular#7289, where there are a few proposed workarounds, the following ones seem good:

@devoto13
Copy link
Collaborator

@toverux the latter approach looks good!

If anybody is willing to submit a PR I would be happy to review it. Otherwise I'll have time to work on this early next week. Please add tests to make sure these 3 syntaxes work correctly: [class]="my-class", [class.my-class]="true" and [ngClass]="{'my-class': true}" with the component.

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

No branches or pull requests

2 participants