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.

fxLayout and fxFlex directives have no effect

See original GitHub issue

Bug Report

Hi. After a few Typescript compilation issues after installing the npm package for the first time, I’ve found a few posts which suggested using 6.0.0-beta.17. This has removed the errors, but the directives don’t work and I’m unable to use the library. I believe I have set everything up correctly.

What is the expected behavior?

fxLayout and fxFlex perform as they should, according to documentation

What is the current behavior?

The two directives mentioned have no discernible effect; no style attributes are added to the relevant elements and their layouts do not change.

What are the steps to reproduce?

Component:

import { Component } from '@angular/core';

@Component({
  selector: 'app-test',
  template: `
    <div fxLayout="row">
      <div fxFlex="50">
        <p>A1 ***</p>
      </div>
      <div fxFlex="50">
        <p>A2 ***</p>
      </div>
    </div>
    <div fxLayout="row">
      <div fxFlex>
        <p>B1 ***</p>
      </div>
      <div fxFlex>
        <p>B2 ***</p>
      </div>
    </div>
  `,
  styleUrls: [ './test.component.scss' ],
})
export class TestComponent {
  constructor () {}
}

App module:

import { FlexLayoutModule } from '@angular/flex-layout';

// Shortened for brevity
@NgModule({
  imports: [ FlexLayoutModule ]
})

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

OSX 10.14 Mojave Google Chrome 69

Dependencies:

"@angular/cdk": "^6.4.5",
"@angular/common": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/flex-layout": "6.0.0-beta.17",
"rxjs": "^6.0.0"

Dev dependencies:

"@angular/cli": "^6.1.5",
"@angular/compiler-cli": "^6.1.0",
"typescript": "^2.8.3"

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
alexk111commented, Nov 1, 2018

FlexLayoutModule should be imported into each module containing a component which uses fxLayout directives

1reaction
jetshotcommented, Apr 4, 2019

You need to import FlexLayoutModule on app module and to any feature module you plan to use it on, same with directives. The affected are those who uses the Lazy Load Feature on their application.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fxFlex has no affect - Stack Overflow
I'm using fsflex to left align the first two divs and right align the 2nd two. I've used a spacer and fsflex but...
Read more >
Angular Flex Layout: The Masquerade | by Aleix Suau - Medium
align-content has no effect on a single-line flex container, only in flex containers with multiple lines. For single-line flex containers use align-items.
Read more >
angular/flex-layout - Gitter
Hi guys, I had an issue with FxLayoutGap. fxLayoutGap puts the gap on the wrong side when used with RTL. I had generated...
Read more >
How To Use Flex Layout for Angular - DigitalOcean
Flex Layout is a component engine for Flexbox layouts in Angular. In this tutorial, you will build an example Angular application and use ......
Read more >
Angular flex layout basics
fxLayout is a directive used to define the layout of the HTML elements. ... fxFlex. This markup specifies the resizing of its host...
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