在我的应用程序中,我有 Products 表,其中包含各种类型的产品。在每条记录中都有列调用updateDetails
,它是一个JSON
具有以下属性的对象。
const updateDetails = { time: '2020-05-28T05:53:31.540Z', userId: 1, officeId: 2}
Run Code Online (Sandbox Code Playgroud)
但在产品表中的一些记录updateDetails
时null
,将任何用户编辑的记录后更新。
我的示例数据库记录如下。
[
{
name: 'Product 1',
type: 'a',
updateDetails: { time: '2020-05-28T05:53:31.540Z', userId: 1, officeId: 2 }
},
{
name: 'Product 2',
type: 'a',
updateDetails: null
},
{
name: 'Product 3',
type: 'a',
updateDetails: { time: '2020-05-27T05:53:31.540Z', userId: 1, officeId: 2 }
},
{
name: 'Product 4',
type: 'a',
updateDetails: null
},
{
name: 'Product 5',
type: 'a', …
Run Code Online (Sandbox Code Playgroud) 我正在使用HTTP
POST
方法下载文件。我想调用另一种方法来向最终用户显示下载进度,直到文件下载完成。如何使用reportProgress
在HttpClient
此。
downfile(file: any): Observable<any> {
return this.http.post(this.url , app, {
responseType: "blob", reportProgress: true, headers: new HttpHeaders(
{ 'Content-Type': 'application/json' },
)
});
}
Run Code Online (Sandbox Code Playgroud) angular ×1
angular7 ×1
express ×1
httpclient ×1
javascript ×1
node.js ×1
postgresql ×1
sequelize.js ×1