我正在尝试将引导开关添加到 Rails 项目中。当我从这里添加脚本时,如下所示:
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/3.3.4/js/bootstrap-switch.js" data-turbolinks-track="true"></script>
Run Code Online (Sandbox Code Playgroud)
我最终在控制台中收到错误:
Uncaught TypeError: Cannot read property 'fn' of undefined
at bootstrap-switch.js:743
at bootstrap-switch.js:19
at bootstrap-switch.js:22
Run Code Online (Sandbox Code Playgroud)
突出显示为红色的 fn 问题如下:
$.fn.bootstrapSwitch = function (option) {
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
Run Code Online (Sandbox Code Playgroud)
有什么想法为什么没有找到吗?或者有人有我可以使用的 bootstrap-switch.js 文件的链接吗?
谢谢!
我还尝试使用bootstrap-switch gem,但这给了我一个不同的错误。
javascript ruby-on-rails twitter-bootstrap angular-ui-bootstrap bootstrap-switch
我试图在IE8中打开AngularUI网站(http://angular-ui.github.io/).在IE8中未正确呈现UI(在最新版本的chrome/firefox中正常工作).这导致我搜索AngularUI模块的浏览器兼容性.小组讨论指出,AngularUI-bootstrap模块不支持IE8(https://groups.google.com/forum/#!topic/angular-ui/8L0739rxdes)但是可以找到下面列出的其他模块的信息.UI-Utils UI模块NG-Grid UI-Router所以问题是,这些模块是否与ie8兼容.如果是,是否有希望在未来继续提供支持.
我使用ui.boostrap作为日期选择器,
http://plnkr.co/edit/GfOQmgW85U2aW3YbZO7T?p=preview
我需要将日期格式化为"yyyy/MM/dd",因为这就是我的RESTapi收到args的方式.在角度中应用$ filter.
http://docs.angularjs.org/api/ng.filter:date
似乎问题已经解决,但是当我更改datepicker中的日期时,格式日期会更改为类似的格式 2014-01-30T00:58:43.000Z
如何使用此工具设置默认格式日期?
如何在大尺寸上调整角度ui bootstrap模式它看起来它不起作用?通过doc页面,它足以添加大小属性https://github.com/angular-ui/bootstrap/tree/master/src/modal/docs,当我尝试添加size ='lg'时(使用ui-bootstrap)版本0.10.0)进入example.js在官方页面的plunker中打开函数它不起作用http://plnkr.co/edit/lNqi9T8HRUHzcleY68KB?p=preview
我需要使用一个dropup菜单.这段代码与ui-bootstrap-tpls-0.10.0.js完美配合:
<div class="btn-group dropup">
<button type="button" class="btn btn-default" ng-click="print('PDF')">{{text}}</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a ng-click="print('PDF')">Pdf</a></li>
<li><a ng-click="print('EXCEL')">Excel</a></li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
升级到ui-bootstrap-tpls-0.11.0.js后,dropup弹出窗口不再显示.任何帮助赞赏.下拉列表仍然按预期工作.
试图在angular-ui模式中加载一个简单的谷歌地图.但是没有运气.数据得到了很好的传递,但没有任何方面的地图...请帮忙.
$modalInstance.opened.then(function() {
var mapOptions = {
center: new google.maps.LatLng(34.834442, -82.3686479),
zoom: 8
};
new google.maps.Map(document.getElementById("eventMap"), mapOptions);
});
Run Code Online (Sandbox Code Playgroud)
在模态html里面:
<div class="row clearfix">
<div class="col-md-5" id="eventMap" style="display: block; height: 150px;"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
我在常规页面HTML中试过这个并且工作得很好......
我错过了什么?先感谢您!
javascript google-maps angularjs angular-ui angular-ui-bootstrap
我一直在研究drupal angularjs模块.我已经安装了bootstrap ui,工作正常.但是,当我使用模态框时,它不起作用.
控制器内的代码:
$scope.alertOnEventClick = function( event, allDay, jsEvent, view ){
$scope.alertMessage = (event.title + ' was clicked ');
console.log($modal);
var modalInstance = $modal.open({
//templateUrl: Drupal.settings.angularjsApp.basePath + '/ng_node/calender/popup',
template: "<div class='modal-header'><h3 class='modal-title'>I'm a modal!</h3>" +
"</div><div class='modal-body'><ul><li>jfksdfhjksd</li><li>jfksdfhjksd</li><li>jfksdfhjksd</li></ul></div>"+
"<div class='modal-footer'><button class='btn btn-primary'>OK</button>" +
"<button class='btn btn-warning'>Cancel</button></div>",
controller: ModalInstanceCtrl,
scope: $scope
});
function ModalInstanceCtrl($scope, $modalInstance) {
console.log("controller class called")
};
Run Code Online (Sandbox Code Playgroud)
我仍然面临着bootstrap ui popup模型的问题.
目前我的日期选择工作正常.但我需要解决一些问题.周六和周日禁用,因此无法选择.
据我所知,官方文件没有说明这个功能.也许使用template-url,但无论如何都不知道在哪里找到它.
任何的想法?我认为解决它真的很容易.
因为它是西班牙语,我需要启用sab.和dom.列.
谢谢.
我试图从uibModal传回一个值.如果用户单击模态的关闭按钮,我可以定义返回
$scope.close = function () {
$modalInstance.close($scope.editMade);
};
Run Code Online (Sandbox Code Playgroud)
但是,如果用户单击背景区域,则此操作无效.
如何为该特定事件定义返回值?