Commit 0e3d3921 authored by Sean Hammond's avatar Sean Hammond

Be explicit about what goes into vm.annotation

Copy individual properties into vm.annotation explicitly, instead of blindly
copying all of domainModel into it. This allows us to see what's in there and
start making decisions about what should/shouldn't be in there.
parent 0fd89fbf
......@@ -115,7 +115,16 @@ function updateViewModel(drafts, domainModel, vm) {
// Extend the view model with a copy of the domain model.
// Note that copy is used so that deep properties aren't shared.
vm.annotation = angular.extend({}, angular.copy(domainModel));
vm.annotation = {
text: domainModel.text,
tags: domainModel.tags,
// FIXME: These and other vm.annotation.* variables that the templates are
// using need to move out of vm.annotation and onto vm.
id: domainModel.id,
target: domainModel.target,
updated: domainModel.updated,
user: domainModel.user
};
// If we have unsaved changes to this annotation, apply them
// to the view model.
......
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