Skip to content

Instantly share code, notes, and snippets.

@jdcauley
Created September 28, 2016 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdcauley/155cd1fccc6803385d68a536c504d406 to your computer and use it in GitHub Desktop.
Save jdcauley/155cd1fccc6803385d68a536c504d406 to your computer and use it in GitHub Desktop.
what the crap
driverInputs.each(function(i){
var data = $(this).getParams();
app.data.drivers.push(data);
if(!app.saved['drivers']){
app.saved['drivers'] = [];
}
var newCopy = app.model.driver.slice(0);
console.log(newCopy);
$.each(newCopy, function(index, item){
$.each(data, function(key, value){
if(item.fieldName === key){
item.value = value;
}
});
});
app.saved['drivers'].push(newCopy);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment