You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
error TS1206: Decorators are not valid here? #3661
Decorators are not supported on function declarations. To quote #2249:
Decorating a function declaration is not allowed as it will block hoisting the function to the top of the scope, which is a significant change in semantics.
Decorating function expressions and arrow functions are not supported. The same effect can be achived by applying the decorator function as var x = dec(function () { });
Decorating function formal parameters is currently not part of the ES7 proposal.
Activity
DanielRosenwasser commentedon Jun 29, 2015
Decorators are not supported on function declarations. To quote #2249:
thariesl commentedon Feb 9, 2018
If somebody still gets this error after the solutions above:
This was my code:
@Effect() constructor(private httpClient: HttpClient, private actions$: Actions, private store: Store<fromRecipe.FeatureState>){ } recipeFetch = this.actions$ .ofType(fromRecipe.FETCH_RECIPES) .switchMap((action: fromRecipe.FetchRecipes) => { return this.httpClient.get<Recipe[]>('https://https://course-recipe-book.firebaseio.com/recipes.json', { observe: 'body', responseType: 'json' }) })and i got the Error: "Decorators are not valid here.
afterwards i simply wrote Pavel Fedotov (@effect)() after the constructor above recipeFetch :)
Worked for me.