Dynamically updating contents of Angularjs Bootstrap UI Modal from another controller

StackOverflow https://stackoverflow.com/questions/19800660

  •  04-07-2022
  •  | 
  •  

Вопрос

I'm searching for a way to update the contents of a message visible from a modal from another controller. The purpose of this is to have a popup appear once a form is submitted indicating the the form is saving, and once an http request is completed, have the popup indicate that saving is completed.

Are there any recommendations as to what type of architecture I can use to enable such a system?

Это было полезно?

Решение

The basic way for making communication between controllers is to create a service or a factory shared by both controllers.

For this method google "Communication between controllers", everything is explained.

Here is a fiddle wrote by somebody:

[http://jsfiddle.net/simpulton/XqDxG/][1]

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top