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

Refactor updateDomainModel()

parent d6903a9d
...@@ -18,12 +18,10 @@ var events = require('../events'); ...@@ -18,12 +18,10 @@ var events = require('../events');
* *
*/ */
function updateDomainModel(domainModel, viewModel) { function updateDomainModel(domainModel, viewModel) {
var i; angular.extend(domainModel, viewModel);
var tagTexts = []; domainModel.tags = viewModel.tags.map(function(tag) {
for (i = 0; i < viewModel.tags.length; i++) { return tag.text;
tagTexts[tagTexts.length] = viewModel.tags[i].text; });
}
angular.extend(domainModel, viewModel, {tags: tagTexts});
} }
......
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