Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
8925ff91
Commit
8925ff91
authored
Dec 07, 2015
by
Sean Hammond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename viewModel -> vm
parent
47d9024d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
annotation.js
h/static/scripts/directive/annotation.js
+9
-10
No files found.
h/static/scripts/directive/annotation.js
View file @
8925ff91
...
...
@@ -85,23 +85,22 @@ function isNew(annotation) {
}
}
/** Copy properties from v
iewModel
into domainModel.
/** Copy properties from v
m
into domainModel.
*
* All top-level properties in v
iewModel will be copied into domainModel,
*
overwriting
any existing properties with the same keys in domainModel.
* All top-level properties in v
m will be copied into domainModel, overwriting
* any existing properties with the same keys in domainModel.
*
* Additionally, the `tags` property of viewModel - an array of objects
* each with a `text` string - will become a simple array of strings in
* domainModel.
* Additionally, the `tags` property of vm - an array of objects each with a
* `text` string - will become a simple array of strings in domainModel.
*
* @param {object} domainModel The object to copy properties to
* @param {object} v
iewModel
The object to copy properties from
* @param {object} v
m
The object to copy properties from
* @returns undefined
*
*/
function
updateDomainModel
(
domainModel
,
v
iewModel
)
{
angular
.
extend
(
domainModel
,
v
iewModel
);
domainModel
.
tags
=
v
iewModel
.
tags
.
map
(
function
(
tag
)
{
function
updateDomainModel
(
domainModel
,
v
m
)
{
angular
.
extend
(
domainModel
,
v
m
);
domainModel
.
tags
=
v
m
.
tags
.
map
(
function
(
tag
)
{
return
tag
.
text
;
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment