ngclass with breakpoints doesn't remove class once added.
See original GitHub issueBug Report
What is the expected behavior?
When ngClass
is used with breakpoint then it should add specified class for that breakpoint and remove once breakpoint changes
for below example
[ngClass.xs] = "'test'"
it should add test
class only for xs breakpoint . If breackpoint changes then it should remove that class.
What is the current behavior?
ngClass is not removing class when screen size changes.
What are the steps to reproduce?
Have a look on below stackblitz. https://stackblitz.com/edit/angular-jau3sq
Try to resize the screen and observe behavior. You will notice test
class is not getting removed when you go from xs to larger size.
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Angular 7+ flex-layout 7.0.0-beta22
Is there anything else we should know?
It was working fine till 7.0.0-beta.19
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to use Angular Flex ngClass with custom breakpoints?
You need to first make a custom directive and import it in your modules. Since your using for ClassDirectives, to fix it:.
Read more >NgClass - Angular
Object - keys are CSS classes that get added when the expression given in the value evaluates to a truthy value, otherwise they...
Read more >Angular Responsive Design: Complete Guide
Learn how to make your Angular components and applications responsive without having to write a single media query.
Read more >Display property - Bootstrap
Display utility classes that apply to all breakpoints, from xs to xl , have no breakpoint abbreviation in them. This is because those...
Read more >Angular CDK's BreakpointObserver - Preston Lamb
The Angular CDK's LayoutModule has a BreakpointObserver class that you can inject into a component, provide a breakpoint (or breakpoints) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Still not working with ^7.0.0-beta.23
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.