我有一个应用程序无法链接/取消链接包,类似于此问题。
特别是在链接MainApplication.java
此错误文件时失败。
错误取消链接时出了点问题。原因:没有这样的文件或目录,请打开“ ./AppName/android/app/src/main/java/co/AppName/AppName/MainApplication.java”
该路径实际上是不正确java/co/AppNAme
应该是java/com/AppName
。
我在任何地方都找不到导致此问题的原因,也找不到任何有关如何设置路径的文档。
我尝试使用babel-plugin-module-resolver
但没有成功,除非我错过了一些东西。有人有类似的问题吗?
我有一个带有控制器和服务的 Nestjs 休息服务器。
在我的控制器中,当有人发出 get 请求时,有 get 函数:
@Get()
getAllFoos() {
return this.fooService.getAllFoos();
}
Run Code Online (Sandbox Code Playgroud)
在我的服务中,有一个从数据库获取文档的功能
async getAllFoos(): Promise<foos[]> {
try {
return await this.fooModel.find().exec();
} catch(e) {
return e;
}
Run Code Online (Sandbox Code Playgroud)
这有效!我现在需要更改它以使其与可观察量一起使用。我将控制器更改为:
@Get()
getAllFoos() {
this.fooService.getAllFoos().subscribe(
response => {
console.log(response);
},
error => {
console.log(error);
},
() => {
console.log('completed');
});
}
Run Code Online (Sandbox Code Playgroud)
以及对此的服务:
getAllFoos(): Observable<foos[]> {
try {
this.fooModel.find().exec();
} catch(e) {
return e;
}
}
Run Code Online (Sandbox Code Playgroud)
我得到的错误是
[Nest] 7120 - 2019-2-20 15:29:51 [ExceptionsHandler] Cannot read property 'subscribe' of undefined +4126ms
Run Code Online (Sandbox Code Playgroud)
错误来自 …
在 ReactJS 中存储用户 ID 以便所有组件都可以访问它的最佳方法是什么?
我已经研究过 Redux 和 Context,但它们似乎只是存储一个 ID(或者我可能遗漏了什么?)。我还研究了将 ID 存储在父组件 (App) 中,但页面刷新会丢失 id :(。
javascript ×2
es6-promise ×1
java ×1
nestjs ×1
observable ×1
react-native ×1
react-redux ×1
reactjs ×1
typescript ×1