简体   繁体   English

从另一个控制器动态更新Angularjs Bootstrap UI Modal的内容

[英]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.

相关问题 angularjs-从另一个控制器访问ui-bootstrap模式关闭和关闭功能 - angularjs - Accessing ui-bootstrap modal dismiss and close function from another controller AngularJS:Angular UI Bootstrap,将数据从模态传递到控制器 - AngularJS: Angular UI Bootstrap, pass data from modal to controller AngularJS UI Bootstrap Modal将对象传递给控制器 - AngularJS UI Bootstrap Modal passing object to controller 从ui引导模态控制器调用函数 - call a function from ui bootstrap modal controller 如何从Angular JS内调用UI Bootstrap模式弹出控制器 - How to call ui bootstrap modal popup controller from within angular js another controller 如何从angularjs中的控制器调用Ui-Bootstrap 0.10.0中的$ modal.open - How to call $modal.open in Ui-Bootstrap 0.10.0 from controller in angularjs 如何从AngularJS控制器打开UI-Bootstrap模态并捕获选择 - How to open a UI-Bootstrap modal from an AngularJS controller and capture selection 使用Module.Controller()语法的AngularJS UI Bootstrap 0.6.0模态 - AngularJS UI Bootstrap 0.6.0 Modal with Module.Controller() syntax AngularJS UI Bootstrap模式共享信息到同一控制器 - Angularjs ui bootstrap modal sharing information to same controller 从AngularJS中的另一个控制器中打开模式 - Opening a modal from within another controller in AngularJS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM