Skip to content

Unable to use this in a library/application targeted for ES5Β #1

@shankarvn

Description

@shankarvn

Hi,

I tried using this in an application targeted for ES5 and it throws an error

@Injectable()
export class FileUploadStoreService extends ComponentStore {

private canceller: Subject = new Subject();

constructor(@Inject(FILE_UPLOAD_SERVICE) private uploadService: IFileUploadService) {
// initial state
super(INITIAL_BUNDLE_STATE); <============ Fails here since super refers to an ES6 class.
}


core.js:7376 ERROR Error: Uncaught (in promise): TypeError: Class constructor ComponentStore cannot be invoked without 'new'
TypeError: Class constructor ComponentStore cannot be invoked without 'new'
at new FileUploadStoreService (libs-file-upload.js:154)
at createClass (core.js:21827)
at _createProviderInstance$1 (core.js:21812)
at createProviderInstance (core.js:21689)
at createViewNodes (core.js:29868)
at callViewAction (core.js:30197)
at execComponentViewsAction (core.js:30116)
at createViewNodes (core.js:29909)
at createRootView (core.js:29795)
at callWithDebugContext (core.js:30803)
at resolvePromise (zone.js:852)
at resolvePromise (zone.js:809)
at zone.js:913
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)


When I change the target of my application to ES6, it works nicely. Is this by design?

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