Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

feat(server): allow ability to specify breakpoints to activate on server #999

Merged
merged 5 commits into from
Jan 16, 2019

Conversation

CaerusKaru
Copy link
Member

@CaerusKaru CaerusKaru commented Jan 15, 2019

On the server, there is no conception of "browser window," because Angular's
browser implementation doesn't implement it. This means MatchMedia breakpoint activations will not work on the server.

Layout SSR will generate CSS Stylesheets for all known breakpoints. And for the static, delivered-first HTML pages the directives are replaced with their associated, generated CSS classnames.

But for programmatic usages of MediaObserver, we don't have a fallback mechanism to announce breakpoint activations. This PR allows a user to specify which activations they want to trigger via the MediaObserver for programmatic view listeners.

This can be done using the following configuration:

FlexLayoutModule.withConfig({serverBreakpoints: ['xs', 'lt-md']})

Fixes #991

@ThomasBurleson
Copy link
Contributor

For clarity, please elaborate on problem and solution in PR body.

@CaerusKaru
Copy link
Member Author

@ThomasBurleson added

@ThomasBurleson ThomasBurleson merged commit 1c136bc into master Jan 16, 2019
@CaerusKaru CaerusKaru deleted the adam/smm branch January 16, 2019 19:06
@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SSR MatchMedia not working
3 participants