首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Angular Bootstrap ng-show modal

Angular Bootstrap ng-show modal
EN

Stack Overflow用户
提问于 2015-12-01 04:35:27
回答 1查看 2.1K关注 0票数 0

因此,我希望在属性触发器为false时显示引导模式,如下面的代码所示。基本上,如果在上面的控件中选择的收益的hasFunds属性为false,那么一旦选择了该收益,就显示modal (将在底部显示该代码),但如果为true,则modal不会发生任何事情。

Code的代码:

代码语言:javascript
复制
<!-- hasFunds Modal -->
<div class="modal fade" id="hasFundsModal" tabindex="-1" role="dialog" aria-labelledby="hasFundsModalLabel" aria-hidden="true" ng-show="benefit.hasFunds == false">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                &times;
                <p>You have already claimed the full amount of your benefit, and so there may be no remaining funds to reimburse this claim. Are you sure you want to continue?</p>
            </div>
            <div class="modal-footer">
                <input type="button" class="naviaBtn naviaBlue" data-dismiss="modal" value="yes">
                <input type="button" class="naviaBtn naviaBlue" data-dismiss="modal" value="no">                                        
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

上面的控件有一个下拉选择器,其中包含触发true或false的属性:

代码语言:javascript
复制
<div class="form-group col-md-6 naviaInp">
    <label for="beneSelect">Select your benefit</label>
    <select class="form-control" name="beneSelect" id="beneSelect" ng-model="benefit" ng-options="item.descr for item in claim" ng-required="true">
         <option value="">Please select a benefit....</option>
     </select>
    <input type="hidden" ng-model="claimInfo.benefitId" ng-change="{{ claimInfo.benefitId = benefit.id }}"/>
</div>
<div ng-show="claimForm.beneSelect.$dirty && claimForm.beneSelect.$error.required" class="errorContainer">
    <p class="claimError"><i class="fa fa-exclamation-circle"></i><span>this is a required field</span></p>
</div>  

目前,没有模式显示真或假。不能从ng-show触发模式吗?

非常感谢。

EN

回答 1

Stack Overflow用户

发布于 2015-12-01 04:50:11

如果您使用的是UI Bootstrap,请参阅模态指令的文档:https://angular-ui.github.io/bootstrap/#/modal

您需要从控制器中使用选项参数调用$uibModal.open(),以便显示模态。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34007516

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档