Sitelet https://github.com/stackblitz/core/issues/2541
Skip to content

Angular lvy in engineBlock cannot compile host metadata correctly #2541

Description

@yangxiaolang

Description of Bug

We have a set of Angular component libraries that we have developed ourselves and we want to create a demo using StackBlitz. However, we are unable to compile it successfully in the EngineBlock environment and we are getting the following error.
image

By process of elimination, we have identified the statement that is causing the compilation error. The mousedown event in the host metadata binding is being incorrectly treated as a string, but this is a valid syntax supported by Angular and can be compiled successfully in local and web container environments, but fails to compile in the EngineBlock environment.

@Component({
  selector: 'aui-time-picker-panel',
  templateUrl: './panel.template.html',
  styleUrls: ['./panel.style.scss'],
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush,
  providers: [
    {
      provide: NG_VALUE_ACCESSOR,
      useExisting: forwardRef(() => TimePickerPanelComponent),
      multi: true,
    },
  ],
  host: {
    mousedown: '$event.preventDefault()',
  },
})

We have temporarily resolved the compilation error in EngineBlock by using HostListener instead of host. However, we would still like to know if there are any special features of Angular Ivy in EngineBlock or if this compilation error will be fixed in the future.

Steps to Reproduce

  1. Go to https://stackblitz.com/edit/angular-ivy-znxtae?file=package.json
  2. Will see the compilation error
  3. Change @alauda/ui version from 6.5.9-beta.4 to 6.5.9-beta.10
  4. Compilation Success

Expected Behavior

Even in @alauda/ui@6.5.9-beta.4 , the compilation will pass

Screenshots/Screencast

If applicable, add screenshots to help explain your problem.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions