andreypopp / andreypopp/autobind-decorator

boundMethod decorator might not be usable in Angular production builds

Abierto
#82 5 comentarios 1 reacción 0 asignados Ver en GitHub
help wanted
Lenguaje dominante
JavaScript
Estrellas
1.4k
Forks
65
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I get this error when running production builds of my Angular app, which contains usages of the boundMethod decorator:

```
Error encountered resolving symbol values statically. Only initialized variables and constants can be referenced because the value of this variable is needed by the template compiler (position 3:22 in the original .ts file), resolving symbol boundMethod in C:/Users/Jeff/[path to my app]/node_modules/autobind-decorator/index.d.ts
```

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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.