angular-bootstrap

angular bootstrap typeahead not working with a dynamic list retrieved by ng-change

倾然丶 夕夏残阳落幕 提交于 2019-12-25 16:53:14
问题 I am working with typeahead directive in angular-bootstrap. My problem is when user change the input, I want to trigger a ng-change event to get the list from the server, then filter the results. After that I want to see the list to be populated with uib-typeahead. For that, I am using an array $scope.list to store the result from the server and then I pass it into uib-typeahead as <div class="input-group"> <input type="text" class="form-control" ng-model="asyncSelected" placeholder="Search

Angular 2 - Bootstrap (Ng2-Bootstrap) typeahead implementation

自作多情 提交于 2019-12-25 06:58:29
问题 I'm trying to implement the NG2-Bootstrap typeahead with no success. This is my code: import {Component} from "angular2/core"; import {CORE_DIRECTIVES, FORM_DIRECTIVES} from 'angular2/common'; import {TYPEAHEAD_DIRECTIVES} from 'ng2-bootstrap'; @Component({ selector: "side-bar", directives: [TYPEAHEAD_DIRECTIVES, CORE_DIRECTIVES, FORM_DIRECTIVES], template: ` <div class="searchArea" [ngClass]="{searchAreaForceLargeWidth: forceShowSearch}"> <form class="searchBlock" [ngClass]="

How to set min-time and max-time for Angular Timepicker?

半腔热情 提交于 2019-12-24 03:41:06
问题 Is there a way to set a minimum time and maximum time for Angular's bootstrap time picker? With Angular's Datepicker setting a min and max date is supported, and I am wondering if there is a similar functionality allowed for the Timepicker. Looking at the settings in the Angular Documentation for Timepicker it does not appear there is a way to do this... but just wondering if anyone is familiar with a way to achieve this behaviour. Thanks in advance for and insights/advice! Edit: To give some

Prevent AngularJS modal from closing based on logic inside the modal controller

纵然是瞬间 提交于 2019-12-24 03:21:23
问题 Is there a way to prevent the an AngularJS modal from closing/dismissing in the controller logic of the modal? What I want is to show a warning when the users closes the modal and the form inside the modal contains unsaved data. I've tried searching for a before close event or something else I could use in the official documentation, but no luck so far. 回答1: You can watch the 'modal.closing' event, broadcasted to the modal's scope, like this: .controller('modalCtrl', function($scope,

Angular transclude in a directive containing a ng-template (generic Confirm Modal)

点点圈 提交于 2019-12-23 16:01:23
问题 Hello I'm struggling while creating a generic confirmation directive based on angular-bootstrap Modal directive. I can't find a way to transclude my content in the ng-template used for the modal construction because the ng-transclude directive isn't evaluated since it's part of a ng-template loaded afterward when executing $modal.open() : index.html (directive insertion) : <confirm-popup is-open="openConfirmation" on-confirm="onPopupConfirmed()" on-cancel="onPopupCanceled()" > Are you sure ?

AngularJs ng-repeat track by $index issue with angular-bootstrap-switch [duplicate]

流过昼夜 提交于 2019-12-21 22:43:49
问题 This question already has an answer here : Problems with `track by $index` with Angular UI Carousel (1 answer) Closed last year . I am having an issue with AngularJs ng-repeat and angular-bootstrap-switch I am using: ng-repeat="item in items track by $index" When I added a new item into the first index of array by: newItem = {}; items.splice(0, 0, newItem); The DOM contain a bs-switch: When a new item added it reuse the first element in array base on $index, so it doesn't re-render (that's

Angular UI Bootstrap Modal: [$injector:unpr] Unknown provider: $uibModalInstanceProvider

此生再无相见时 提交于 2019-12-17 23:32:21
问题 This is a bit strange. When I search this issue online I see many pages of Google results and SO solutions... but none seem to work! In a nutshell, I am trying to implement AngularUI Bootstrap Modal. I keep getting the following error: Error: [$injector:unpr] Unknown provider: $uibModalInstanceProvider <- $uibModalInstance <- addEntryCtrl Here is my HTML: <nav class="navbar navbar-default"> <div class="container"> <span class="nav-col" ng-controller="navCtrl" style="text-align:right"> <a

How to create a tooltip?

喜你入骨 提交于 2019-12-17 10:09:11
问题 I want to make a custom CSS class for tooltip which will wrap a string of length more than 25-30.Usually such a long text doesn't fit into the tootltip text area. And is there anyway to do this using Tooltip (ui.bootstrap.tooltip) ? Like using custom CSS class to get the desired output. This is the simple css tooltip - Plunker DEMO Here is the code Snippet for the same : .tooltip { position: relative; display: inline-block; border-bottom: 1px dotted black; } .tooltip .tooltiptext { max-width

what happens to scope property if two controllers that apply to one html element define it on scope

筅森魡賤 提交于 2019-12-13 06:58:17
问题 I have the following HTML: <div ng-controller="MainController"> <div class="words"> <span ng-repeat="word in words" ng-click="setActiveWord(word)"> {{word.name}}</span> </div> <tabset> <tab ng-repeat="tab in tabs" heading="{{tab.title}}" active="tab.active" disabled="tab.disabled"> {{activeWord.name}} </tab> </tabset> </div> Then I have a definition for the MainController which adds tabs property to the scope: .controller('MainController', ['$scope', function($scope) { $scope.setActiveWord =

angular typeahead filter: use html tags

自作多情 提交于 2019-12-12 04:36:41
问题 I'm using a filter with angular typeahead to append an extra item onto the typeahead suggestion list like so: app.filter('finalAppend', function($sce){ return function(array, value){ array.push({ name: $sce.trustAsHtml('Look for <b>' + value + '</b> in other shops'), type: 'good' }); return array; } }); I want to return html encoded string, but angular automatically sanitizes it. I tried using $sce as suggested, but it doesn't seem to work. Here's the plunkr: plunkr thanks in advance. 回答1: It