问题标签 [angular-ui-bootstrap]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
4340 浏览

angularjs - 如何在 Angular UI Bootstrap 中设置模板变量?(手风琴)

我尝试使用 Angular UI Bootstrap ( http://angular-ui.github.io/bootstrap/#/accordion ) 构建一个手风琴。关于如何根据选择的手风琴组设置模型。UI Bootstrap我找到了一个使用模板的工作解决方案。

在我的代码中,我添加了模板<script type="text/ng-template" id="template/accordion/accordion-group.html">

在这个模板中可以使用{{heading}}set by <accordion-group heading="{{group.title}}" content="{{group.content}}" ng-repeat="group in groups"></accordion-group>

但是如何设置其他自定义模板变量?我也尝试设置content="{{group.content}}"手风琴标签。即使设置了,我也不知道怎么用,试过{{content.group}} {{content}}{% content %}

完整代码: http: //plnkr.co/dSIVGg64vYSTAv5vFSof

0 投票
3 回答
8342 浏览

angularjs - 使用 $dialog 多次打开同一个对话框

我在回答这个问题“ AngularJS - 在对话框中打开控制器(动态加载模板) ”时创建了这个 plnkr

示例应用程序所做的只是启动一个基于模板的对话框,并带有它自己的控制器。对话框第一次启动时,一切都按预期工作。但是,如果我尝试重新启动对话框,在将其关闭后,会显示模态背景但没有对话框。在 javascript 控制台中,您可以看到then返回的 promise 上的方法$dialog.open()被立即调用,但背景没有被移除,也没有报告错误。我完全感到困惑。

该对话框可以在 angular-ui bootstrap文档页面上反复打开和关闭。

我哪里做错了?

HTML:

JS:

0 投票
2 回答
2279 浏览

ruby-on-rails - Rails 中的 Angular ui 引导自定义模板

如何在rails中使用angular ui bootstrap的自定义模板?

我的意思是,如果我使用pagination例如它会寻找一个templates/pagination/pagination.html模板。

问题是 rails 不会在该路径中提供模板,它实际上需要assets/templates/pagination/pagination.html使用<%= asset_path(....) %>帮助程序。

破解 angular ui bootstrap javascript 文件是一种方法,但我不想每次获得新版本时都破解它。

0 投票
5 回答
50729 浏览

javascript - 扩展 AngularJs 指令

我想对第 3 方指令(特别是Angular UI Bootstrap)进行细微修改。我只是想添加到pane指令的范围:

但我也想让 Angular-Bootstrap 与 Bower 保持同步。一旦我运行bower update,我将覆盖我的更改。

那么我该如何将这个指令与这个 bower 组件分开扩展呢?

0 投票
2 回答
5957 浏览

angularjs - Angular UI Bootstrap Modal 在指令中的使用

我想创建一个confirmation-dialog-header指令,该指令将打开一个Bootstrap UI 模态,它将像这样使用:

这是我正在尝试做的事情(CoffeeScript):现场演示

不幸的是,modal默认没有隐藏,点击按钮似乎没有任何效果。

任何帮助,将不胜感激。

0 投票
1 回答
2183 浏览

angularjs - AngularJS:为什么以及何时需要调用 $timeout?

现场演示

我创建了一个confirmationDialogHeader这样使用的指令:

单击按钮时,应该打开一个确认对话框,如果用户确认,它应该调用deleteItem($index)并关闭对话框。

我的问题是最后一点:关闭对话框

这是控制器(CoffeeScript):

这是指令:

如您所见,对话框在完成后并没有关闭并被执行。deleteItem()$scope.confirmationDialog = off

有趣的是,如果$scope.items.splice(index, 1)用 包裹$timeout,对话框正确关闭!

为什么$timeout这里需要这种包装?

是否有关于我们何时应该用 包装代码的指导方针$timeout


该指令的工作版本使用$dialog.


0 投票
2 回答
10186 浏览

popover - Angular UI Bootstrap popover with close button

I am using Angular UI Bootstrap to create a popover but I am unable to find the option to add a close button inside the popover.

I customized the popover template to include the close button. But I am still unable to find a function/event to close the popover. Setting isOpen to false works for the first time as it just overwrites the function - but thereafter becomes unusable.

Here is the template script:

I thought of writing a directive for close button to trigger the 'click" event of "POPOVER WITH CLOSE" button. But I am not sure if that's the approach to follow.

What's the correct approach to follow?

0 投票
0 回答
1249 浏览

angularjs - 在模板中使用引导下拉菜单时,Angular 对话框第一次立即关闭

当用户单击按钮时,我试图打开一个对话框。我发现当我向对话框模板添加引导下拉菜单时,第一次单击(从“打开对话框”按钮)立即返回。如果您第二次(第三次、第四次……)单击“打开对话框”按钮,那么一切都会按预期进行。

我缺少一些初始化代码吗?

HTML

脚本.js

样式.css

这是一个说明问题的plunker:

http://plnkr.co/edit/lJy5l6vlLycP4VlSiObE?p=preview

0 投票
1 回答
44231 浏览

javascript - 在 AngularJS 中使用来自不同控制器的 $scope 函数

我想在另一个控制器中共享一个控制器的 $scope 函数,在这种情况下是一个 AngularUI 对话框。

特别是在下面的示例中,我希望 $scope.scopeVar 在 PopupCtrl 中可用。

这是一个Plunkr

在此处根据 mlarcher 的评论解析代码

main.js

索引.html

myPopup.html

0 投票
1 回答
1861 浏览

angularjs - Angular UI Bootstrap 不适用于 AngularJS 事件处理

我是 Angular 的新手并且有一些基本问题,让 Angular-UI-Bootstrap 与 AngularJS 结合使用。这是一个简单的示例,一个使用 ng-change 进行事件处理的常用输入字段,并且有一个弹出框。没有 popover 属性,代码可以正常工作。添加弹出框属性后,弹出框正确显示,看起来不错,但是当输入字段的值更改时,没有调用事件处理程序,也没有更新密码模型。

同样的问题也存在,例如,如果我有一个带有事件处理代码和弹出框的按钮。如果我不使用弹出框,但使用工具提示,也会出现同样的问题。

我正在使用 ui-bootstrap-tpls-0.3.0.js 和 AngularJS v1.0.7。

有人知道问题是什么吗?