angular-ui-bootstrap

How to close an Angular-ui-bootstrap uibModal on mouseleave using Factory?

99封情书 提交于 2019-12-12 13:18:56
问题 I've recently switched all our modals directives in our app over to Angular-ui-Bootstrap modals. Much better, however running into a new style of modal which closes on mouseleave instead of a cancel click. this.leaveTag = (tag) => { TagHover.off(); }; this.hoverTag = (tag) => { TagHover.display(); }; Above is the view logic that calls functions inside of our TagHover Factory. Below is the Factory, the TagHover.display works fine like with our other modals, but what I'm trying to do with the

How can I make by default accordion to make open first element?

混江龙づ霸主 提交于 2019-12-12 11:16:12
问题 I use bootstrap accordion in my project. Here is working fiddler . Here is HTML code: <div ng-app="myapp"> <div ng-controller="AccordionDemoCtrl"> <uib-accordion close-others="oneAtATime"> <uib-accordion-group ng-repeat="group in groups" is-open="isOpen"> <uib-accordion-heading> <div class="text-center"> <strong>{{group.title}}</strong> <i class="pull-right glyphicon" ng-class="{'glyphicon-chevron-down': isOpen, 'glyphicon-chevron-right': !isOpen}"></i> </div> </uib-accordion-heading> {{group

Updating the model from a typeahead-on-select

匆匆过客 提交于 2019-12-12 10:47:55
问题 Consider the following in the body of my html file: <html> ... <body> ... <div class='container-fluid' ng-controller="TypeaheadCtrl"> <input type="text" ng-model="selected" typeahead="name as entry.name for entry in entries | filter:{name: $viewValue} | limitTo:8" typeahead-on-select='onSelect($item, $model, $label)' class="form-control"> {{selection_made}} </div> <body> </html> where entries are populated somewhere else. And then this in the controller: angular.module('ui.bootstrap.demo')

Returning data from angular $uibModal backdrop click

送分小仙女□ 提交于 2019-12-12 09:47:18
问题 I'm trying to pass back a value from a uibModal. I can define the return if the user clicks the modal's close button $scope.close = function () { $modalInstance.close($scope.editMade); }; But this doesn't work if the user click the backdrop area. How can I define a return value for that particular event? 回答1: When you click on the backdrop outside, it does a dismiss internally. Try using this inside modal: $modalInstance.dismiss($scope.editMade); And use this to handle data: instance.result

Angular UI.Bootstrap's radio buttons act strange with ng-repeat [duplicate]

早过忘川 提交于 2019-12-12 09:30:44
问题 This question already has an answer here : Setting and getting bootstrap radio button inside angular repeat loop (1 answer) Closed 6 years ago . I have a problem dynamically generating options for a radio model in angular's ui.bootstrap. I thought I could simply ng-repeat over an array, using it's contents for the btn-radio attribute like so: //in the controller $scope.radioModel = undefined; $scope.radioModelButtons = ["a", "b", "c"]; //in the html <div class="btn-group" > <button ng-repeat=

Returning a value from a modal in Angular Bootstrap

会有一股神秘感。 提交于 2019-12-12 07:17:36
问题 I'm trying to use the modal directive from Angular Bootstrap to pop up a dialog, change a value (that was passed in) and then retrieve it. However, for some reason the value never gets updated in the scope. And, in fact, if I put in a "ng-change" and stick a breakpoint in it, it seems that there's another level of scope being created for some reason. I've created a plunker here: http://plnkr.co/edit/Vy6gLgOJbWcLsHJtaGpV?p=preview I'm baffled by this. Any ideas? 回答1: Javascript passes

Angular-UI $dialog and form submit on enter key

北城余情 提交于 2019-12-12 07:11:43
问题 From what I can see, the recomended way to handle enter key in dialogs in AngularJS is to place a <form> tag and a submit button inside the dialog. Fair enough, but if you use Angular-UI and their $dialog service, the form will simply close silently when pressing enter. no way to intercept that. even if you attach handlers to ng-click or ng-submit, the form will just close w/o returning any result. Is there something else I need to do [Edit] Solved it, I had to specify explicitly that my

Modal Popups in AngularJS using angular-ui-router ($stateProvider) without updating the browser url

孤街醉人 提交于 2019-12-12 05:27:54
问题 My criteria was: Open a modal from anywhere in my app Don't rewrite the url, leave it as is from before opening the modal When pressing the back button on the browser don't remember modal states and reopen them Don't include lots of options in the markup when ui-sref is being used I'm using $stateProvider in my angularjs application to handle the routing - I love how easy it is to display a modal using ui-sref element attributes along with onEnter event in the .state function. The issue I'm

AngularJS + UI Bootstrap Typeahead implementation issue

时光怂恿深爱的人放手 提交于 2019-12-12 04:55:42
问题 I am trying to implement Typeahead using my Web Api controller by adopting to this code, that works fine: HTML <div class='container-fluid' ng-controller="TypeaheadCtrl2"> <pre>Model: {{result | json}}</pre> <input type="text" ng-model="result" typeahead="suggestion for suggestion in cities($viewValue)"> </div> Controller in app.js myApp.controller('TypeaheadCtrl2', function ($scope, $http, limitToFilter) { //http://www.geobytes.com/free-ajax-cities-jsonp-api.htm $scope.cities = function

My directive stops working combined with another.. Angular.js

那年仲夏 提交于 2019-12-12 04:48:44
问题 I have a directive to edit a field dynamically called "click-to-edit". If I click on an item, I can edit it without problems. <span ng-click="ignoreClick($event);" > <a href='' click-to-edit item="faq" ng-model='faq.pregunta' typeinput='textarea'>{{faq.pregunta}} </a> I have a filter that highlights a word when it is found, this filter is called "highligth". If I add the line ng-bind-html="faq.pregunta | highlight:search.pregunta" I can not click to edit the field. but the filter works for me