【发布时间】:2017-03-16 06:42:52
【问题描述】:
我需要根据各种条件在我的项目中单击按钮时实现警报框。您能否建议我如何使用 Angular 2 实现警报框,我不需要传统的 window.alert()
【问题讨论】:
-
我们可以不使用引导程序来实现吗
-
有没有办法获取$window.alert?
标签: angular alert popupwindow angular2-modal
我需要根据各种条件在我的项目中单击按钮时实现警报框。您能否建议我如何使用 Angular 2 实现警报框,我不需要传统的 window.alert()
【问题讨论】:
标签: angular alert popupwindow angular2-modal
你可以使用 angular2 包
npm install ng2-modal --save
`<button (click)="myModal.open()">Show popup</button>
<modal #myModal>
<modal-header>
<h1>Your header goes here</h1>
</modal-header>
<modal-content>
Body goes here
</modal-content>
<modal-footer>
<button class="btn btn-primary (click)="myModal.close()">Cancel</button>
</modal-footer>
</modal>`
【讨论】: