0
This is my file code Modal
$scope.salvarObservacao = function (data) {
if(data.dsObservacaoEvento === undefined | data.dsObservacaoEvento === '' ) {
alert('Campo obrigatório.');
return false;
}
EventoService.salvarObservacao($rootScope.idEvento,data).then(function(dados){
toaster.pop('success','Participantes','Dado salvo com sucesso.');
// toaster.pop ({
// type: 'success',
// title: 'Participantes',
// body: 'Dado salvo com sucesso.',
// onHideCallback: function () {
// $modalStack.dismissAll();
// }
// });
}).catch(function(err){
//...
});
setTimeout($modalStack.dismissAll(),3000);
};
}],
templateUrl: 'modal/incluir-observacao.html'
}
});
Good afternoon Leufrasio, How is your template? Depending on the case, if I understand your question correctly, you have a list of observations, and at each update you want it to update on screen. Assuming you have a list of observations that you iterate via ng-repeat just call the method that lists the observations again or increment this list with the new data entered. The bi-directional angle will automatically update the information on screen. https://docs.angularjs.org/guide/databinding. If this modal is loaded inside an iframe, a solution would be via javascript
– Almer Nakano
Good afternoon Leufrasio, How is your template? Depending on the case, if I understand your question correctly, you have a list of observations, and at each update you want it to update on screen. Assuming you have a list of observations that you iterate via ng-repeat just call the method that lists the observations again or increment this list with the new data entered. The bi-directional angle will automatically update the information on screen. https://docs.angularjs.org/guide/databinding. If this modal is loaded inside an iframe, a solution would be via javascript
– Almer Nakano
In the system I have a 'include observation' field, I need that when saving this ''observation', in the 'observation' button a hint showing this last information without having to refresh the page. Could you forward me a line of code as an example, pfv ??
– Leufrasio
I don’t know if I got it right how you want me to display this hint, from what you’ve described now, it’s just a Oast to say that the data has been updated ? It wouldn’t just be a message recording the success of the operation?
– Almer Nakano
No Almer, this is happening successfully, follows so on the page: 'include note' > opens the window to edit > click save > msg appears that was saved successfully > returns to the page where you can re-include a note... but in the right corner there is an icon that when placing the mouse on it is where the hint should appear with this new observation that I saved, But I need her to show up without having to refresh. The new observation edited only appears in the hint after pressing F5 !!... gave to understand better so ?... I wait...
– Leufrasio
Now I get it. Then try the following: in your modal callback, refresh the angular scope with $Scope.apply(); just make sure it is called after the data is saved.
– Almer Nakano