question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ngclass with breakpoints doesn't remove class once added.

See original GitHub issue

Bug 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mhosmancommented, Jan 14, 2019

Still not working with ^7.0.0-beta.23

0reactions
angular-automatic-lock-bot[bot]commented, Sep 5, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found