[英]Dynamically updating contents of Angularjs Bootstrap UI Modal from another controller
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.
这样做的目的是,一旦提交表单以表明该表单正在保存,就会弹出一个窗口,一旦http请求完成,就让弹出窗口表明该保存已经完成。
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] [http://jsfiddle.net/simpulton/XqDxG/][1]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.