Creating a custom breakpoint for fxFlex is not working
After implementing custom break point for and creating a directive for it, I should be able to use said directive in a tag and it should adhere to the values given.
for example I have created a directive for fxFlex.xxs while maintaining the defaults for existing breakpoints.
new directive does not have any effect. curious if default breakpoint of flexFx.xs will override my custom breakpoint of flexFx.xxs
import {BREAKPOINT} from '@angular/flex-layout';
const XXS_BREAKPOINTS = [{
alias: 'xxs',
suffix: 'flexXxs',
mediaQuery: 'screen and (max-width: 395px)',
overlapping: false
}];
export const CustomBreakPointsProvider = {
provide: BREAKPOINT,
useValue: XXS_BREAKPOINTS,
multi: true
};
3.create new directive for new breakpoint
import {Directive, ElementRef, Input} from '@angular/core';
import { MediaMonitor, negativeOf, FlexDirective, LayoutDirective, StyleUtils} from '@angular/flex-layout';
@Directive({
selector: `[fxFlex.xxs]`
})
export
class CustomXxsDirective extends FlexDirective {
constructor(monitor: MediaMonitor, elRef: ElementRef, _container: LayoutDirective,styleUtils: StyleUtils) {
super(monitor, elRef, _container,styleUtils,true);
console.log('here')
}
@Input('fxFlex.xxs') set flexXxs(val) { this._cacheInput('flexXxs', val); };
}
add directive to declarations so that it can be used.
use as you would any othe fxFlex directive
flex-layout 5.0.0-beta.14
I also disabled default break points to see if they were conflicting with my new breakpoint. That also did not work.
Please provide a StackBlitz reproduction we can investigate.
@CaerusKaru
https://stackblitz.com/edit/angular-ltjzwn
My thought is when we decrease the screen width below 395 px, the boxes should wrap one per row.
see line 14 in app.component html.
I thought maybe the flexFx.xs directive was superceeding my custom directive but when i turn off default breakpoints my custom directive still doesn't work
Ok, I can see how the docs are a little confusing here. You have two choices:
fxFlex.xss, use fxFlex.flexXxs as you have defined abovesuffix field from your breakpoints definitionThis 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._
Most helpful comment
Ok, I can see how the docs are a little confusing here. You have two choices:
fxFlex.xss, usefxFlex.flexXxsas you have defined abovesuffixfield from your breakpoints definition