Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fxHide with custom breakpoint directive not working in AOT #961

Closed
hags033 opened this issue Dec 27, 2018 · 8 comments · Fixed by #969
Closed

fxHide with custom breakpoint directive not working in AOT #961

hags033 opened this issue Dec 27, 2018 · 8 comments · Fixed by #969
Assignees
Labels
bug can be closed? custom breakpoints Issues with Custom Breakpoint configuration and use P1 Urgent issue that should be resolved before the next re-lease related: angular-core
Milestone

Comments

@hags033
Copy link

hags033 commented Dec 27, 2018

Bug Report

What is the expected behavior?

Expect for the element to hide at desired custom breakpoint

What is the current behavior?

Element hides at desired custom breakpoint when not running aot, but does not hide in aot

What are the steps to reproduce?

https://stackblitz.com/edit/angular-flex-layout-seed-j5xkix

What is the use-case or motivation for changing an existing behavior?

Adding in a min-height breakpoint

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

Angular 7.1.4, Typescript 3.1.6 Flex Layout 7.0.0-beta.22 all browsers

Is there anything else we should know?

You'll need to download the stackblitz and run ng serve (angular.json already set to run aot build)

@CaerusKaru CaerusKaru added needs: investigation custom breakpoints Issues with Custom Breakpoint configuration and use labels Dec 27, 2018
@CaerusKaru
Copy link
Member

The StackBlitz you've provided contains no trace of custom breakpoints. Please add it and then follow-up here.

@hags033
Copy link
Author

hags033 commented Dec 28, 2018

Forgot to hit save on the stackblitz, the demo link is now up to date.

@CaerusKaru CaerusKaru added bug P1 Urgent issue that should be resolved before the next re-lease and removed needs: demo needs: investigation labels Dec 28, 2018
@CaerusKaru CaerusKaru self-assigned this Dec 28, 2018
@CaerusKaru CaerusKaru added this to the 7.0.0-beta.23 milestone Dec 28, 2018
@CaerusKaru
Copy link
Member

Damn that is a terrible bug. I'll investigate this weekend and hopefully track this down. Thanks for catching this!

@ThomasBurleson
Copy link
Contributor

ThomasBurleson commented Jan 4, 2019

@CaerusKaru - this is working great with the latest code base. I added it to our demos.
But [as reported] the custom hide bp does NOT work with AOT...

/**
 * This one fails to instantiate in demo app with AOT!!
 */
@Directive({selector, inputs})
export class CustomHideDirective extends ShowHideDirective {
   protected inputs = inputs;
}

// ****************************************
// Core Library 
// ****************************************

/**
 * Core ‘show’ Layout API directive
 */
@Directive({selector, inputs})
export class DefaultShowHideDirective extends ShowHideDirective {
  protected inputs = inputs;
}

export class ShowHideDirective extends BaseDirective2 implements AfterViewInit, OnChanges {
  constructor(protected elementRef: ElementRef,
              protected styleBuilder: ShowHideStyleBuilder,
              protected styler: StyleUtils,
              protected marshal: MediaMarshaller,
              @Inject(LAYOUT_CONFIG) protected layoutConfig: LayoutConfigOptions,
              @Inject(PLATFORM_ID) protected platformId: Object,
              @Optional() @Inject(SERVER_TOKEN) protected serverModuleLoaded: boolean) {
    super(elementRef, styleBuilder, styler, marshal);
  }

 //....
}

export abstract class BaseDirective2 implements OnChanges, OnDestroy {
  protected constructor(protected elementRef: ElementRef,
                        protected styleBuilder: StyleBuilder,
                        protected styler: StyleUtils,
                        protected marshal: MediaMarshaller) {
  }

 //....
}

ThomasBurleson added a commit that referenced this issue Jan 4, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Closes #961.
ThomasBurleson added a commit that referenced this issue Jan 4, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Closes #961.
ThomasBurleson added a commit that referenced this issue Jan 8, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Closes #961.
ThomasBurleson added a commit that referenced this issue Jan 10, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Closes #961.
ThomasBurleson added a commit that referenced this issue Jan 10, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Refs #961.
@CaerusKaru
Copy link
Member

There's a chance this was patched by #978. @hags033 can you build this against 7.0.0-beta.23 and see if the issue still exists?

@CaerusKaru
Copy link
Member

Anecdotally I can confirm this has been patched by updating the StackBlitz and running ng serve --aot locally. If this is still an issue, we can reopen later.

@hags033
Copy link
Author

hags033 commented Jan 11, 2019

@CaerusKaru works great, thanks for addressing this so quickly.

ThomasBurleson added a commit that referenced this issue Jan 13, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Refs #961.
ThomasBurleson added a commit that referenced this issue Jan 13, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Refs #961.
ThomasBurleson added a commit that referenced this issue Jan 13, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Refs #961.
ThomasBurleson added a commit that referenced this issue Jan 13, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Refs #961.
ThomasBurleson added a commit that referenced this issue Jan 13, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Refs #961.
ThomasBurleson added a commit that referenced this issue Jan 13, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Refs #961.
ThomasBurleson added a commit that referenced this issue Jan 13, 2019
Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Refs #961.
ThomasBurleson added a commit that referenced this issue Jan 13, 2019
…969)

Add demo showing custom breakpoint working with `fxHide.yba-min-height`
Refs #961.
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug can be closed? custom breakpoints Issues with Custom Breakpoint configuration and use P1 Urgent issue that should be resolved before the next re-lease related: angular-core
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants