Files
freeCodeCamp/guide/chinese/miscellaneous/fixing-exportsupdate-in-angular/index.md
2018-10-16 21:32:40 +05:30

15 lines
625 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Fixing Exportsupdate in Angular
localeTitle: 在Angular中修复Exportsupdate
---
事实证明,在**thing.controller.js**以及在可能产生的任何其它端点这就是所谓的_exports.update_功能当您从您的前端修改现有的数据库对象_$ http.put_电话坏了。这是一个[已知问题](https://github.com/DaftMonk/generator-angular-fullstack/issues/310) ,可以通过更改以下行来修复:
```
// Updates an existing thing in the DB.
exports.update = function(req, res) {
...
var updated = _.extend(thing, req.body);
// change _.merge to _.extend
...
};
```