angular-ui

Wrapping angular typeAhead in separate directive

萝らか妹 提交于 2019-12-11 13:29:28
问题 My goal was to wrap angular-ui typeAhead directive into easily re-usable component, that could be used like this: <input my-person-lookup="myModel.personId" ></input> I've achieve this by writing my custom directive, and specifying static template for typeahead. Here is Plunker Now, I would like to build this template dynamically, and then compile it: var html = '<input type="text" ng-model="directiveModel.selectedPerson" typeahead=" p as p.name for p in people" typeahead-min-length="1"

AngularJS multiple radio options

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 13:28:37
问题 Good afternoon, We are currently trying to learn AngularJS and although we're picking up some pretty cool codes we can't seem to figure this issue out. We are wanting to display a list of product options relative to the selected product within the dropdown feature from here we want to be able to tick one radio button on each row but at the moment when we tick one of the radio buttons it seems to be selecting all within each of the columns. We've attached our code snippets and screenshots, if

Angular ui-select2 - hide initial drawing/rendering of component

旧巷老猫 提交于 2019-12-11 13:19:24
问题 I'm evaluating using Angular with ui-select2 and wondered whether someone could provide help on hiding the flicker/conversion of the <select> into the select2 component. It's only very brief, but users can see the component change styles. Is there a way of hiding it until the select has been modified by select2? 回答1: I came across the same problem and I had a look at the source code. The directive is deliberately initialised later by using a timeout. In the code there is a comment saying

Angular UI Router, route resolve breaking refresh button

天涯浪子 提交于 2019-12-11 13:07:16
问题 I am having an issue with Angular UI router. When I route the below state, it works completely fine. However, when I refresh the page, the resolve gets the data, it is injected into the controller, but the view does not load. In short, the state works fine when it is routed to via a ui-sref link or $state.go, but not when the page is refreshed. Has anyone encountered this issue before? $stateProvider.state('information', { templateUrl: 'information.html', resolve:{ 'infoData': function($q,

angular-ui datepicker max-date doesn't work properly

可紊 提交于 2019-12-11 13:06:44
问题 I am trying to get the min-date and max-date to be set from the datepicker-options , but have been unsuccessful. A code snippet is attached. Any help? Thanks! angular.module('ui.bootstrap.demo', ['ui.bootstrap']); angular.module('ui.bootstrap.demo').controller('DatepickerDemoCtrl', function ($scope) { $scope.today = function() { $scope.dt = new Date(); }; $scope.today(); $scope.dateOptions = { formatYear: 'yy', minDate: '05/01/2015', startingDay: 1 }; $scope.formats =['dd/MM/yyyy', 'dd-MMMM

How to call collapseAll function on Angular UI tree?

人走茶凉 提交于 2019-12-11 12:45:49
问题 I am using the angular-ui-tree directive to show a tree in my AngularJS application. However, I would now like to collapse the tree. The documenation states that there is a function called collapseAll on the scope, but doesn't show an example of how to call this. Searching Google has brought up this issue where someone asks for exactly the same thing - unfortunately the linked answer results in a 404. What I don't get is: If this function is accessible via the scope of the ui-tree directive,

call function in angular ui tooltip

↘锁芯ラ 提交于 2019-12-11 12:41:57
问题 Have used this code which invokes the user defined function : getTooltipText <i tooltip=\"{{ getTooltipText(arg1) }}\"> </i> .... //function definition $scope.getTooltipText = function(arg1){ console.log(arg1); // prints undefined .... return text; } But it is not working. Have even tried trinary operator, but no luck!! Any suggestion? 回答1: instead of {{ getTooltipText(arg1) }} ,may be you can use ngMouseenter and ngMouseleave directive. <div ng-mouseenter="getTooltipText(arg1)"> <i tooltip="

Dynamically add options to a Angular chosen combo box

孤者浪人 提交于 2019-12-11 12:30:15
问题 The following code doesn't work: <select ui-jq='chosen' ng-model='trainer_list' multiple class="form-control" data-placeholder="Select Multiple Trainers" ng-options='trainer.id as trainer.name for trainer in trainers'> </select> I took this from an Angular Bootstrap theme, and I'm struggling to use it. Basically I want to use from this angular script $http({ method: 'GET', url: 'http://localhost/training_system/retrieve_train.php?trainer=Y' }).success(function (result) { $scope.trainers =

Angular UI Router resolve throwing provider error

∥☆過路亽.° 提交于 2019-12-11 11:09:16
问题 I seem to be having an issue with Angular UI router and trying to add a resolve to a state. The weird thing is, that I have it in another place and it works fine. I'm separating my code out into different component areas, my code structure is like this: /app /component-dashboard index.js /controllers DashboardCtrl.js /component-chart-1 index.js /controllers Chart1Ctrl.js For example I have the root dashboard and this works fine: // index.js angular.module('az-ci') .config([ '$stateProvider',

Angular UI directive inside custom directive

浪子不回头ぞ 提交于 2019-12-11 11:06:25
问题 Similar question but the question isn't sufficiently answered In the following code, why doesn't uib-datepicker-popup turn into an angular UI date picker? Am I missing some flag/compile option for the directive? This is a stripped down example of the datepicker-popup example in the Angular-UI documentation, modified to be inside a directive. Notice how it works when used with the controller but doesn't work in my example with the directive. angular.module('ui.bootstrap.demo', ['ngAnimate',