-
Notifications
You must be signed in to change notification settings - Fork 66
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
boundMethod decorator might not be usable in Angular production builds #82
Comments
Another workaround is to change index.d.ts to make boundMethod the default export, as in:
With this, of course, using the autobind decorator would result in a production-build compile error similar to the one described above. |
Is it a typescript issue? If so I don't use it so help is needed. In essence, we should always do |
I'm sorry - yes, it is a TypeScript issue. Most everyone who uses Angular 2+ uses TypeScript for their coding. To be able to do as you have prescribed, a person would have to employ the second workaround I've given, above.. I don't know if you want to incorporate that change into the package, or not. It makes boundMethod the default export. |
I think (I might not be correct since I don't use typescript) the problem is since |
@stevemao That is understandable. I guess I will have to continue using my fork with the workaround in it. |
I get this error when running production builds of my Angular app, which contains usages of the boundMethod decorator:
I believe it is the Angular AoT compiler which is throwing this error. Devleopment builds, which don't use AoT, don't produce these errors.
I import the decorator using
import { boundMethod } from "autobind-decorator";
A workaround is to use the autobind decorator instead, though that is discouraged by this package's docs.
The text was updated successfully, but these errors were encountered: