ng-boostrap 介绍
modal#
NgbActiveModal 链接#
Class
A reference to the currently opened (active) modal.
对当前打开的(active)modal 的引用,(就是现实的内容)。
Instances of this class can be injected into your component passed as modal content. So you can .update()
, .close()
or .dismiss()
the modal window from your component.
此类的实例可以注入到作为模态内容传递的组件中。所以你可以 .update()
, .close()
或者 .dismiss()
从你的组件的模态窗口。
Methods
update since 14.2.0 |
update(options: NgbModalUpdatableOptions) => voidUpdates options of an opened modal. 更新打开的模式的选项。 |
---|---|
close |
close(result: any) => void使用可选 result 值关闭模态。 The NgbModalRef.result promise will be resolved with the provided value.NgbModalRef.result 承诺将使用提供的值进行解析。 |
dismiss |
dismiss(reason: any) => voidDismisses the modal with an optional reason value.关闭具有可选 reason 值的模态。 The NgbModalRef.result promise will be rejected with the provided value.NgbModalRef.result 承诺将被拒绝,并提供的价值。 |
NgbModal 链接#
Service 服务
A service for opening modal windows.
用于打开模态窗口的服务。
Creating a modal is straightforward: create a component or a template and pass it as an argument to the .open()
method.
创建模态非常简单:创建一个组件或模板,并将其作为参数传递给 .open()
方法。
Properties 性能
activeInstances |
Returns an observable that holds the active modal instances. 返回保存活动模态实例的可观察对象。 Type: EventEmitter<NgbModalRef[]> 类型: EventEmitter<NgbModalRef[]> |
---|
Methods 方法
open |
open(content: any, options: NgbModalOptions) => NgbModalRefOpens a new modal window with the specified content and supplied options. 打开包含指定内容和提供选项的新模式窗口。 Content can be provided as a TemplateRef or a component type. If you pass a component type as content,then instances of those components can be injected with an instance of the NgbActiveModal class. You can then use NgbActiveModal methods to close / dismiss modals from "inside" of your component. 内容可以作为 TemplateRef 组件类型或组件类型提供。如果将组件类型作为内容传递,则可以将这些组件的实例注入 NgbActiveModal 到类的实例中。然后, NgbActiveModal 您可以使用方法从组件的“内部”关闭/关闭模态。Also see the NgbModalOptions for the list of supported options. NgbModalOptions 另请参阅支持的选项列表。 |
---|---|
dismissAll since 3.1.0 从 3.1.0 开始 |
dismissAll(reason: any) => void Dismisses all currently displayed modal windows with the supplied reason. 关闭所有当前显示的模式窗口,并提供原因。 |
hasOpenModals since 3.3.0 从 3.3.0 开始 |
hasOpenModals() => boolean Indicates if there are currently any open modal windows in the application. 指示应用程序中当前是否有任何打开的模式窗口。 |
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 在鹅厂做java开发是什么体验
· 百万级群聊的设计实践
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
· 永远不要相信用户的输入:从 SQL 注入攻防看输入验证的重要性
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
2018-04-25 《大型网站技术架构》1.大型网站架构演练
2017-04-25 《jquery实战》javascript 必知必会(2)
2017-04-25 《jquery实战》javascript 必知必会(1)