0
Follow
8
View

在初始化NestJs Decorators之前运行代码

dickshensyf 注册会员
2022-11-23 06:06

装饰器计算为常规JS代码,当文件被需要时计算。在装饰器之前运行某些东西的唯一方法是在文件中有更高的东西,之前就像有

export const foo = () => {
  console.log('foo');
}

console.log('Here we are exporting foo');

和想要在export const foo = () => { console.log('foo'); } console.log('Here we are exporting foo'); 之前运行一些东西。唯一的方法是让您想要运行的内容在文件中更高的位置运行,或者在这个文件之前运行

About the Author

Question Info

Publish Time
2022-11-23 06:06
Update Time
2022-11-23 06:06