Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

es2015/es6 directive support #953

Closed
Closed
@epelc

Description

@epelc

Bug Report

What is the expected behavior?

The layout directive(and I think others like flex directive) do not work when targeting es6 in your tsconfig. Everything works fine when targeting es5. I also suspect this might affect the custom breakpoint directives because they are also subclasses.

What is the current behavior?

You get an error that init is not a method on undefined because I assume the constructor arguments are not injected on subclasses.
image
image

core.js:18374 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'init' of undefined

Basically none of the arguments are injected.

What are the steps to reproduce?

Providing a StackBlitz (or similar) is the best way to get the team to see your issue.

Change the value of "target" in tsconfig.js to es6.

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

Compiling smaller libs with newer/faster es6

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

7.0 beta 22

Is there anything else we should know?

Angular material had the same issue and it was very finicky but has finally been fixed in angular/components#13834. It is really due to an underlying issue with angular itself which ivy is supposed to fix but there is an outstanding PR to fix it in the current renderer.

@devversion has dealt with fixing this heavily perhaps he could advise best course of action? There were a lot of pitfalls during the fixes for angular material so hopefully he has some input on the final fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions