Created
March 23, 2015 11:08
-
-
Save 0xae/3dee1d408ac099f64f3c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.save = function (data){ | |
_prepareSectionToSave(data); | |
var i = data.attr.agregados || 0; | |
var agregados = parseInt(data.attr.elements[6].attr.value); | |
$localForage.getItem("51::fields").then( | |
function (agregadoQuest){ | |
var conf = agregadoQuest[0]; | |
for(; i<agregados; i++){ | |
var agregadoQuestChave = "RGA::agregado::" + edificio + "." + alojamento + "." + (i+1); | |
var conf2 = angular.copy(conf); | |
conf2.attr.elements[1].attr.value = (i+1); | |
$localForage.setItem(agregadoQuestChave, conf2); | |
} | |
data.attr.agregados = i; | |
$localForage.setItem(chave, data); | |
$state.go("app.agregados", {idEdificio: edificio, idAlojamento: alojamento}); | |
} | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment