How to customise FlexDirective with custom breakpoints?
See original GitHub issueI have defined a set of custom breakpoints and have successfully managed to create custom directives for:
- LayoutDirective
- ShowHideDirective
However, I ran into a problem when trying to customise the FlexDirective. A snippet of my customised code looks like this
import { FlexDirective, LayoutDirective, StyleUtils, MediaMonitor } from '@angular/flex-layout';
import { LAYOUT_CONFIG, LayoutConfigOptions } from '@angular/flex-layout/core';
@Directive({
selector: `
[fxFlex.mobile],
[fxFlex.s.tablet],
[fxFlex.l.tablet],
[fxFlex.l.tablet.landscape],
[fxFlex.web]
`
})
export class CustomFlexDirective extends FlexDirective {
constructor(monitor: MediaMonitor,
elRef: ElementRef,
@Optional() @Self() layout: LayoutDirective,
styleUtils: StyleUtils,
@Inject(LAYOUT_CONFIG) layoutConfig: LayoutConfigOptions) {
super(monitor, elRef, layout, styleUtils, layoutConfig);
}
...
}
The problem I get is that the elements LAYOUT_CONFIG and LayoutConfigOptions do not seem to be available anywhere - the import for LAYOUT_CONFIG and LayoutConfigOptions fails. I also did a search across all of @angular/flex-layout in my node_modules folder and could not find these anywhere.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Angular Fxlayout Custom Breakpoints - StackBlitz
function updateBreakpoints(bp:BreakPoint) {. switch(bp.alias) {. case 'sm' : bp. ... register a Custom BREAKPOINT Provider. {. provide: BREAKPOINTS,.
Read more >How to Use Breakpoints in MUI's SX Prop (5 Examples)
Here's a guide to customizing breakpoints in the MUI Theme. Create Responsive Layout with MUI SX Breakpoints. Perhaps the most common ...
Read more >MUI System
The system lets you quickly build custom UI components leveraging the values defined in your theme. Demo. (Resize the window to see the...
Read more >Breakpoints - NativeBase
Breakpoints are the building blocks of responsive design. ... useBreakpointValue is a custom hook which returns the value for the current breakpoint from ......
Read more >React-admin - Theming
For instance, to create a custom <Datagrid> component with the header style defined in the ... Use the theme breakpoints to check for...
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
The documentation for custom breakpoints really needs to be made clearer with better examples, and explanation on overriding defaults.
The default breakpoints for tablet sized devices are 600 and 960 and the width of an iPad (most of them) is 768. So 600 is way too small and 960 won’t get triggered.
So many people will be wanting to add a breakpoint corresponding to that size and the documentation essentially just talks about printing breakpoints.
Totally agree to @simeyla . An example with modifying the default breakpoints and adding additional ones and add e.g. a “lt-xl”-directive would be very useful.