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

How to customise FlexDirective with custom breakpoints? #767

@Mufasa

Description

@Mufasa

I 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions