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

fix(badge): apply view encapsulation attributes on badge element #12870

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

crisbeto
Copy link
Member

Since we create the badge content element dynamically, the view encapsulation attributes won't be applied. These changes use the renderer to create the element, which will respect view encapsulation.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Aug 28, 2018
@crisbeto crisbeto requested a review from amcdnl as a code owner August 28, 2018 15:33
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Aug 28, 2018
@jelbourn
Copy link
Member

What practical effect does this change have? I'd rather avoid introducing use of Renderer2 since it may make it more difficult to work with the ivy renderer at some point in the future

@crisbeto
Copy link
Member Author

The issue that it solves is that if somebody decided to do .mat-badge-content { color: red } inside a component with view encapsulation, those styles won't apply to the badge, even though the element is inserted next to other elements that will receive the styling.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I see, we can figure out any problems later, then. Just needs rebase.

@crisbeto crisbeto force-pushed the badge-view-encapsulation branch from 5b7ad4b to d4de8d5 Compare August 28, 2018 20:04
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Aug 28, 2018
Since we create the badge content element dynamically, the view encapsulation attributes won't be applied. These changes use the renderer to create the element, which will respect view encapsulation.
@crisbeto crisbeto force-pushed the badge-view-encapsulation branch from d4de8d5 to b7166c9 Compare August 28, 2018 20:43
@jelbourn jelbourn merged commit db1d51f into angular:master Aug 29, 2018
jelbourn pushed a commit that referenced this pull request Aug 29, 2018
)

Since we create the badge content element dynamically, the view encapsulation attributes won't be applied. These changes use the renderer to create the element, which will respect view encapsulation.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants