问题标签 [angular-strap]
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.
angularjs - How can I provide callbacks for an AngularStrap or Angular UI Bootstrap Popover, to execute on open and on close?
I am using the Angular UI Bootstrap popover ( http://angular-ui.github.io/bootstrap/#/popover ) and would like to specify a callback function to execute when it is opened and another for when it is closed. My use case is that I am using the popover to contain filters for a grid of data. I would like to load some remote filtering options on open, apply the selected filters only when the popover is closed.
The documentation only appears to support a few basic options but no indication of callback support. I'm not seeing anything in the source code either. Is my only option to set an interval function to check periodically if the popover is visible in the DOM?
I'm also considering Angular Strap's popover to achieve the same result, but can't seem to find the option to set callbacks there either.
angularjs - 必须打开两次才能使用 angular-strap 模态显示数据
我在使用 angular-strap 模态时遇到问题。我正在尝试使用 $http 获取数据并将其结果显示到模式中。奇怪的部分是我必须打开模态两次才能显示/显示数据。我在下面有这段代码:
使用 firebug 控制台,我认为它在我的 $http 调用中首先触发了 console_log(items),然后是 console.log(result)。因此,当我再次打开模式时,它会显示数据。我如何同步我的 $http 以便首先调用它?
unit-testing - 在单元测试中找不到模块
添加 angularStrap 模块后一切正常,除了在我的单元测试中我收到以下错误:
所以 var httpBackend = null
我将它添加到主模块:
将 js 文件添加到 index.html
我的单元测试:
当我从我的应用程序模块中删除“$strap.directives”时,我的单元测试工作。有人知道为什么在我的单元测试中找不到这个表带模块吗?
angularjs - angular-strap 模态指令不显示内容两次
我无法让 angular-strap 模态指令正常工作。内容只显示一次,之后我只得到 {{angular-expression-here}}。来自 angular-strap 页面的原始链接也不起作用。您只能在第一次看到“Hello Modal”。如果您想再次看到该消息,您必须更改它(例如:“Hello Modal 1”)。
如果您使用“with $http service”按钮,就会发生这种情况。
这里的笨蛋
javascript - 我想在弹出窗口中使用指令,使用 angular-strap
我正在使用 Angular-Strap。我想在弹出框的内容中使用指令。这是来自 Angular-Strap (bs-popover) 的相关代码:
问题在于,第一次弹出框定位的计算与其他时间不同。调试后我注意到第一次应该显示内容的弹出框没有被编译,编译函数似乎有异步过程。工具提示已保存(如缓存),因此下次弹出窗口计算内容已经编译并且我得到正确的结果。
angularjs - 角带绑定 datePicker 不适用于开始和结束日期?
我使用角带 datePicker
当从代码更改 endDate 或 startDate 时,它会在 DOM 中更新,但日期选择器仍然不知道此更改,是否需要触发某种更新?
更改是通过同一范围内的with 函数完成的,然后为andng-click
设置一个新值。endDate
startDate
像这样(CoffeeScript):
编辑:
这是解决方案:
在控制器构造函数中,我存储来自和到控件的日期:
然后当setDateRange
被调用时,我做了一些辅助方法来调用datepicker
setEndDate
andsetStartDate
方法:
javascript - angular-strap $modal 不被拒绝
我正在尝试使用模态服务。以下有什么问题:
angularjs - 在两个 Angular js 控制器之间共享函数
我有一个要求。我正在使用 Angularstrap Modal 进行模态对话(用户条款和条件)。
在这个模态对话中,有两个按钮是“同意”和“不同意”。
我有两个链接。单击每个链接会打开不同的视图。两个视图都与不同的控制器相关联。我的要求是,每当新用户到来时,我都需要打开条款对话,并且需要在两个链接的点击事件上打开。目前我必须在每个控制器中编写模态代码。(打开模态和模态按钮的功能相同)
现在,我想概括模态和模态按钮的代码。我想写一次,我想在需要打开(任何)模态时使用该代码
什么是方法或有可能?
javascript - AngularStrap Select 和 ng-options 不能很好地使用动态数组
我正在使用 AngularJS 和 AngularStrap(指令 Select,基于 Silvio Moreto 制作的 Bootstrap-Select)。我有下一个问题:
我有很多汽车品牌。使用 ng-options,我将它们像选项一样放在选择中。换句话说,当我选择一个选项(汽车品牌)时,我会得到这个汽车品牌的不同型号,并将它们显示为另一个选择中的选项。
问题是当我使用 AngularStrap 指令选择时,它不能很好地工作。我第一次选择一个汽车品牌,它工作正常,但下一个选择的选项(汽车品牌),它显示选择的汽车品牌的型号和选择的前一个汽车品牌的第一个型号。
当我不使用 AngularStrap 选择时,它运行良好,因此我认为问题出在 AngularStrap 选择中。
谢谢你的帮助。
我的代码是下一个:
HTML:
控制器(JS):
javascript - 如何在角带中的另一个模态中实现模态?
我正在将 angular-strp 用于模态框。我的要求是我想在模式框中加载页面时显示有关页面的信息。当用户在模态框上单击确定时,我需要关闭该模态并向用户显示另一个模态以选择国家。
我正在使用 ng-click 在第一个模态 ok 按钮上调用一个函数来关闭第一个模态并在该函数中打开另一个模态。
无论如何通过在角带中关闭另一个来链接模态从打开一个?