Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shankarvn opened this issue Sep 21, 2020 · 0 comments
Open

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

shankarvn opened this issue Sep 21, 2020 · 0 comments

Comments

@shankarvn
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant