Skip to content

Commit

Permalink
Add support for mapping arrays of primitive objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
mackd committed Dec 14, 2011
1 parent a89bf00 commit 6cf9a53
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion knockout.mapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,11 @@ ko.exportProperty = function (owner, publicName, object) {
switch (key.status) {
case "added":
var item = getItemByKey(ko.utils.unwrapObservable(rootObject), key.value, keyCallback);
mappedItem = ko.utils.unwrapObservable(updateViewModel(undefined, item, options, parentName, mappedRootObject, fullPropertyName));
mappedItem = updateViewModel(undefined, item, options, parentName, mappedRootObject, fullPropertyName);
var unwrap = ko.utils.unwrapObservable(mappedItem);
if(unwrap instanceof Object) {
mappedItem = unwrap;
}

var index = ignorableIndexOf(ko.utils.unwrapObservable(rootObject), item, ignoreIndexOf);
newContents[index] = mappedItem;
Expand Down

0 comments on commit 6cf9a53

Please sign in to comment.