我更新了联系人,但无法取回更新的对象来更新视图,而是获得了 Bootstrap includes a responsive, mobile first fluid grid system that
appropriately scales up to 12 columns as the device or viewport size
increases.
It includes predefined classes for easy layout options, as well as
powerful
mixins for generating more semantic layouts.
。
{n: 1, nModified: 1, ok: 1}
export class ContactService {
url: string = 'http://localhost:3000/contacts/';
constructor(private http: HttpClient) {
}
async Update(contact: Contact) {
return await this.http.put(this.url.concat(contact._id), contact);
}
}
export class ContactComponent implements OnInit {
async update() {
const updatingContact = await this.contact.Update(contact);
updatingContact.subscribe(result => {
console.log(result); // {n: 1, nModified: 1, ok: 1}
})
}
}
如何在router.put('/:id', async (req, res) => {
try {
const contact = await Contact.updateOne({ _id: req.params.id }, {
firstname: req.body.firstname,
phone: req.body.phone
});
res.json(contact);
}
catch (err) {
debug(err.message)
}
})
方法中获取更新的对象以更新视图?
答案 0 :(得分:0)
可能是别人遇到这个问题。
Ext.getCmp('datef').expand();