Commit 69ba0233 authored by Sean Hammond's avatar Sean Hammond

Refactor updateDomainModel()

parent d6903a9d
......@@ -18,12 +18,10 @@ var events = require('../events');
*
*/
function updateDomainModel(domainModel, viewModel) {
var i;
var tagTexts = [];
for (i = 0; i < viewModel.tags.length; i++) {
tagTexts[tagTexts.length] = viewModel.tags[i].text;
}
angular.extend(domainModel, viewModel, {tags: tagTexts});
angular.extend(domainModel, viewModel);
domainModel.tags = viewModel.tags.map(function(tag) {
return tag.text;
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment