fxHide with custom breakpoint directive not working in AOT
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)
The StackBlitz you've provided contains no trace of custom breakpoints. Please add it and then follow-up here.
Forgot to hit save on the stackblitz, the demo link is now up to date.
Damn that is a terrible bug. I'll investigate this weekend and hopefully track this down. Thanks for catching this!
@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) {
}
//....
}
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?
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.
@CaerusKaru works great, thanks for addressing this so quickly.
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.