Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$injector cannot instantiate ES6 classes #12597

@mprobst

Description

@mprobst

This code (paraphrasing) fails with TypeError: Class constructors cannot be invoked without 'new':

class Foo { constructor() { } }
var foo = $injector.instantiate(Foo);

The reason is that ES6 disallows using fn.apply on class constructors.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions