How to create an Angular Flex-Layout stylebuilder to generate a default fxLayoutGap? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience Should we burninate the [wrap] tag? The Ask Question Wizard is Live!How to Right-align flex item?Huge number of files generated for every Angular projectConfused about @NgModule provided in Angular 2How to properly use @angular/flex-layout?Angular Flex Layout - Not workingunable to get rid of a x-overflow (scrollbar is hidden but I can still scroll to the right)Angular4 multiple modules issueAngular flex-layout struggleAngular Flex Layout ELI5 'lt' vs 'gt'Angular Material only works with Angular Flex-layout?

Is it ethical to give a final exam after the professor has quit before teaching the remaining chapters of the course?

At the end of Thor: Ragnarok why don't the Asgardians turn and head for the Bifrost as per their original plan?

What does this icon in iOS Stardew Valley mean?

Seeking colloquialism for “just because”

Why aren't air breathing engines used as small first stages

Resolving to minmaj7

What causes the vertical darker bands in my photo?

Why are Kinder Surprise Eggs illegal in the USA?

Can a USB port passively 'listen only'?

Bete Noir -- no dairy

What's the purpose of writing one's academic biography in the third person?

Sci-Fi book where patients in a coma ward all live in a subconscious world linked together

Output the ŋarâþ crîþ alphabet song without using (m)any letters

Is it fair for a professor to grade us on the possession of past papers?

How to tell that you are a giant?

When do you get frequent flier miles - when you buy, or when you fly?

Why was the term "discrete" used in discrete logarithm?

If a contract sometimes uses the wrong name, is it still valid?

Why are there no cargo aircraft with "flying wing" design?

How do pianists reach extremely loud dynamics?

Echoing a tail command produces unexpected output?

Single word antonym of "flightless"

What exactly is a "Meth" in Altered Carbon?

What is the meaning of the new sigil in Game of Thrones Season 8 intro?



How to create an Angular Flex-Layout stylebuilder to generate a default fxLayoutGap?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
Should we burninate the [wrap] tag?
The Ask Question Wizard is Live!How to Right-align flex item?Huge number of files generated for every Angular projectConfused about @NgModule provided in Angular 2How to properly use @angular/flex-layout?Angular Flex Layout - Not workingunable to get rid of a x-overflow (scrollbar is hidden but I can still scroll to the right)Angular4 multiple modules issueAngular flex-layout struggleAngular Flex Layout ELI5 'lt' vs 'gt'Angular Material only works with Angular Flex-layout?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am trying to create a style builder to generate a default fxLayoutGap if none is specified, as outlined here:



This is my setup



module



@NgModule(
...
providers: [
provide: LayoutGapStyleBuilder, // when default is requested
useClass: DefaultLayoutGapStyleBuilder // provide instead custom builder
]
)


default-layout-gap-style-builder.ts



import Injectable from '@angular/core';
import LayoutGapParent, LayoutGapStyleBuilder, StyleDefinition from '@angular/flex-layout';

@Injectable()
export class DefaultLayoutGapStyleBuilder extends LayoutGapStyleBuilder
buildStyles(input: string, parent: LayoutGapParent): StyleDefinition '10px';

return super.buildStyles(input, parent); // THIS RETURNS




view.html



<div fxLayout="row wrap" fxLayoutGap>


Everything seems to be hooked up correctly, but the call to super.buildStyles is not returning anything so a default gap style of 10px is not applied.










share|improve this question




























    1















    I am trying to create a style builder to generate a default fxLayoutGap if none is specified, as outlined here:



    This is my setup



    module



    @NgModule(
    ...
    providers: [
    provide: LayoutGapStyleBuilder, // when default is requested
    useClass: DefaultLayoutGapStyleBuilder // provide instead custom builder
    ]
    )


    default-layout-gap-style-builder.ts



    import Injectable from '@angular/core';
    import LayoutGapParent, LayoutGapStyleBuilder, StyleDefinition from '@angular/flex-layout';

    @Injectable()
    export class DefaultLayoutGapStyleBuilder extends LayoutGapStyleBuilder
    buildStyles(input: string, parent: LayoutGapParent): StyleDefinition '10px';

    return super.buildStyles(input, parent); // THIS RETURNS




    view.html



    <div fxLayout="row wrap" fxLayoutGap>


    Everything seems to be hooked up correctly, but the call to super.buildStyles is not returning anything so a default gap style of 10px is not applied.










    share|improve this question
























      1












      1








      1








      I am trying to create a style builder to generate a default fxLayoutGap if none is specified, as outlined here:



      This is my setup



      module



      @NgModule(
      ...
      providers: [
      provide: LayoutGapStyleBuilder, // when default is requested
      useClass: DefaultLayoutGapStyleBuilder // provide instead custom builder
      ]
      )


      default-layout-gap-style-builder.ts



      import Injectable from '@angular/core';
      import LayoutGapParent, LayoutGapStyleBuilder, StyleDefinition from '@angular/flex-layout';

      @Injectable()
      export class DefaultLayoutGapStyleBuilder extends LayoutGapStyleBuilder
      buildStyles(input: string, parent: LayoutGapParent): StyleDefinition '10px';

      return super.buildStyles(input, parent); // THIS RETURNS




      view.html



      <div fxLayout="row wrap" fxLayoutGap>


      Everything seems to be hooked up correctly, but the call to super.buildStyles is not returning anything so a default gap style of 10px is not applied.










      share|improve this question














      I am trying to create a style builder to generate a default fxLayoutGap if none is specified, as outlined here:



      This is my setup



      module



      @NgModule(
      ...
      providers: [
      provide: LayoutGapStyleBuilder, // when default is requested
      useClass: DefaultLayoutGapStyleBuilder // provide instead custom builder
      ]
      )


      default-layout-gap-style-builder.ts



      import Injectable from '@angular/core';
      import LayoutGapParent, LayoutGapStyleBuilder, StyleDefinition from '@angular/flex-layout';

      @Injectable()
      export class DefaultLayoutGapStyleBuilder extends LayoutGapStyleBuilder
      buildStyles(input: string, parent: LayoutGapParent): StyleDefinition '10px';

      return super.buildStyles(input, parent); // THIS RETURNS




      view.html



      <div fxLayout="row wrap" fxLayoutGap>


      Everything seems to be hooked up correctly, but the call to super.buildStyles is not returning anything so a default gap style of 10px is not applied.







      angular flexbox angular-flex-layout






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 17:36









      Jeff MitchellJeff Mitchell

      1,0571428




      1,0571428






















          1 Answer
          1






          active

          oldest

          votes


















          2














          According to the source code if the value you pass in, '10px' in this case, does not end in ' grid'; than it will return the empty object and not give you the gap layout. I'm guessing you will want to use a different builder or input for your use case.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55068282%2fhow-to-create-an-angular-flex-layout-stylebuilder-to-generate-a-default-fxlayout%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            According to the source code if the value you pass in, '10px' in this case, does not end in ' grid'; than it will return the empty object and not give you the gap layout. I'm guessing you will want to use a different builder or input for your use case.






            share|improve this answer



























              2














              According to the source code if the value you pass in, '10px' in this case, does not end in ' grid'; than it will return the empty object and not give you the gap layout. I'm guessing you will want to use a different builder or input for your use case.






              share|improve this answer

























                2












                2








                2







                According to the source code if the value you pass in, '10px' in this case, does not end in ' grid'; than it will return the empty object and not give you the gap layout. I'm guessing you will want to use a different builder or input for your use case.






                share|improve this answer













                According to the source code if the value you pass in, '10px' in this case, does not end in ' grid'; than it will return the empty object and not give you the gap layout. I'm guessing you will want to use a different builder or input for your use case.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 8 at 18:05









                Jace RheaJace Rhea

                4,16433155




                4,16433155





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55068282%2fhow-to-create-an-angular-flex-layout-stylebuilder-to-generate-a-default-fxlayout%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    1928 у кіно

                    Захаров Федір Захарович

                    Ель Греко