PrimeNG 自动完成模块的问题
Issue with the Autocomplete Module of PrimeNG
我在 Gist 中有我的代码:
https://gist.github.com/rickymuvel/8ddc4d14d90877329447ddde9c0aa835
我正在使用 PrimeNG,特别是我的问题是自动完成模块。不要调用 ubigeo.service.ts 文件中的特定路径。以下是对每个文件的作用的回顾:
usuario.component.html 我已经清理了它,所以它只出现导致我出现问题的字段。实际上在 HTML 中没什么可做的,因为如果信息到达服务,但 "post" 请求没有得到解决。
usuario.component.ts使用两个服务(目前,因为我打算再添加三个使用)。这是完整的代码。
ubigeo.service.ts 是我遇到错误的服务。然而这里失败的是 "post" 请求,simply that line is not executed.
usuario.service.ts包含用户对应的逻辑。我不知道它是否会影响错误,但我 post 它。
由于您的 cargarUbigeo
服务调用是 observable
,您必须 subscribe()
,否则 observable
不会触发。
添加它,看看是否收到回调:
Buscar(event){
this._ubs.cargarUbigeo(event.query )
.subscribe(data => {
console.log(data);
})
}
我在 Gist 中有我的代码: https://gist.github.com/rickymuvel/8ddc4d14d90877329447ddde9c0aa835
我正在使用 PrimeNG,特别是我的问题是自动完成模块。不要调用 ubigeo.service.ts 文件中的特定路径。以下是对每个文件的作用的回顾:
usuario.component.html 我已经清理了它,所以它只出现导致我出现问题的字段。实际上在 HTML 中没什么可做的,因为如果信息到达服务,但 "post" 请求没有得到解决。
usuario.component.ts使用两个服务(目前,因为我打算再添加三个使用)。这是完整的代码。
ubigeo.service.ts 是我遇到错误的服务。然而这里失败的是 "post" 请求,simply that line is not executed.
usuario.service.ts包含用户对应的逻辑。我不知道它是否会影响错误,但我 post 它。
由于您的 cargarUbigeo
服务调用是 observable
,您必须 subscribe()
,否则 observable
不会触发。
添加它,看看是否收到回调:
Buscar(event){
this._ubs.cargarUbigeo(event.query )
.subscribe(data => {
console.log(data);
})
}