Skip to content

Instantly share code, notes, and snippets.

@haric
Created June 6, 2012 00:53
Show Gist options
  • Select an option

  • Save haric/2879185 to your computer and use it in GitHub Desktop.

Select an option

Save haric/2879185 to your computer and use it in GitHub Desktop.
Ember clone view
function cloneFromView(obj) {
if (null == obj || "object" != typeof obj) return obj;
var copy = Ember.View.create({
templateName: obj.templateName
});
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr];
}
return copy;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment