Flex-layout: import of FlexLayoutModule

Created on 10 Feb 2017  路  9Comments  路  Source: angular/flex-layout

Today I updated my Flex-Layout to beta.5 and the app fails to even load due to FlexLayoutModule calling a lambda function. After some research I saw we should not use forRoot anymore. So I removed it.

Then I ran into an issue where FlexLayoutModule is undefined when trying to import it.

I have found if i point my import to : "@angular/flex-layout/flexbox"
that it works fine, but if i use the high level import it fails.

This could be related to #175

bug demo

Most helpful comment

Just to confirm the understanding ... if i used this I was getting an error because FlexLayoutModule was undefined

import { MaterialModule }   from "@angular/material";
import { FlexLayoutModule } from "@angular/flex-layout";


@NgModule({
    imports: [
        MaterialModule.forRoot(),
        FlexLayoutModule
    ]

However if i used this it worked correctly.

import { MaterialModule }   from "@angular/material";
import { FlexLayoutModule } from "@angular/flex-layout/flexbox";


@NgModule({
    imports: [
        MaterialModule.forRoot(),
        FlexLayoutModule
    ]

However my understanding was that I should be able to leave my path for my input the same. And I am not sure the ticket #176 resolves this issue or not.

All 9 comments

174

Just to confirm the understanding ... if i used this I was getting an error because FlexLayoutModule was undefined

import { MaterialModule }   from "@angular/material";
import { FlexLayoutModule } from "@angular/flex-layout";


@NgModule({
    imports: [
        MaterialModule.forRoot(),
        FlexLayoutModule
    ]

However if i used this it worked correctly.

import { MaterialModule }   from "@angular/material";
import { FlexLayoutModule } from "@angular/flex-layout/flexbox";


@NgModule({
    imports: [
        MaterialModule.forRoot(),
        FlexLayoutModule
    ]

However my understanding was that I should be able to leave my path for my input the same. And I am not sure the ticket #176 resolves this issue or not.

Same issue for me, had to change from "@angular/flex-layout" to from "@angular/flex-layout/flexbox" in order to make it work.

@pigeonvictor - which version of @angular/flex-layout do you have installed. Are you using Angular CLI (which version)?

@here - please note that our Plunkrs work as expected... https://plnkr.co/edit/sMh5vKrVQAglBq2MSSrr?p=preview.

@tmburnell, @pigeonvictor - can you zip your project (without the node_modules) and send to me via email ([email protected]). I am unable to reproduce this issue.

Building an example: with the newest material and flex-layout ... it works.
I noticed that material just removed forRoot also (in the last few days).

But it does seem to work fine now.

Closing as no longer valid.

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mhosman picture mhosman  路  3Comments

MarcusMorba picture MarcusMorba  路  3Comments

spottedmahn picture spottedmahn  路  5Comments

MarcusMorba picture MarcusMorba  路  3Comments

nueko picture nueko  路  5Comments