How to update "Modal" web page without refreshing (F5) after accessing last information?

Asked

Viewed 589 times

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

  • 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

  • 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 ??

  • 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?

  • 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...

  • 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.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.