Se creo la vista modal para editar persona

parent 49e1882e
......@@ -2,25 +2,20 @@
(()=> {
class PersonaEditarModalController {
constructor($uibModalInstance, parametro, personaService) {
this.persona = {};
this.alertas = [];
this.enviado = false;
this.modal = $uibModalInstance;
this.service = personaService;
this.personaId = parametro.personaId;
this.service.getPersona(this.personaId)
.then((persona)=>{
this.persona = persona;
console.log(persona);
})
this.persona = Object.assign({}, parametro.persona);
}
guardarPersona(form) {
this.enviado = true;
if (form.$valid) {
this.service.editarPersona(this.personaId, this.persona)
this.service.editarPersona(this.persona._id, this.persona)
.then((persona)=>{
this.modal.close(persona);
})
......
......@@ -146,7 +146,7 @@
controller: 'PersonaEditarModalCtrl',
controllerAs: 'vm',
resolve: {
parametro: {personaId: persona._id}
parametro: {persona: persona}
}
}).result.then(persona=> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment