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