angular-ui

angular-ui global key bindings

时光毁灭记忆、已成空白 提交于 2019-12-10 12:58:52
问题 I've started using the angular-ui keypress module and was wondering if there is a way to make global shortcut keys which work no matter where I'm placed within the body. I've tried linking my ui-keydown to the body but as it's not in focus the key events are not fired. eg: <body ui-keydown="{'pageup':'nav_to($event, \'users\')'}"> I know I could just focus a div and attach the key bindings to that but what happens when I have a form and I want to access all the global key bindings within each

angular-ui/bootstrap: Testing a controller that uses a dialog

筅森魡賤 提交于 2019-12-10 11:23:46
问题 I've a controller that uses a Dialog from angular-ui/bootstrap: function ClientFeatureController($dialog, $scope, ClientFeature, Country, FeatureService) { //Get list of client features for selected client (that is set in ClientController) $scope.clientFeatures = ClientFeature.query({clientId: $scope.selected.client.id}, function () { console.log('getting clientfeatures for clientid: ' + $scope.selected.client.id); console.log($scope.clientFeatures); }); //Selected ClientFeature $scope

angular-ui/ui-router with Steroids

假如想象 提交于 2019-12-10 11:15:01
问题 I am trying to get a basic example running that uses Steroids and Angular-UI/UI-routes for an app with nested views. I created a Steroids app using the startup example here, and then I am trying to populate it with the angular-UI/UI-raouter example here (this is their Plunkr). My opening page only shows " State 1 State 2 " literally. So something is off, but I think I have reached the end of my debugging and guessing skills. Here is what I have thus far: I added a 'partials' folder in the app

AngularJS - Conditionally apply an attribute?

拟墨画扇 提交于 2019-12-10 09:23:01
问题 Conditionally applying an element is easy - just use ng-show. But what about an attribute? IE <div ui-sortable> ... </div> needs to be sortable only for admins, so do something like... <div ng-conditional-attribute=" {'ui-sortable': 'user.isAdmin()'} "> ... </div> 回答1: Create a custom directive or template and switch between the version with sortable attached and the version without. 回答2: Since a lot of directives also work from class you might be able to use ng-class="{'ui-sortable': user

How to implement server side pagination in angularjs using angular-ui bootstrap.?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 06:15:17
问题 Please suggest different methods to implement server side pagination using angular js and angular-ui bootstrap. I would be paginating a table listing using ng-repeat according to current page selected in angualr-ui bootsrap pagination directive. Since we need to avoid frequent calls to server. We need to fetch 50 items from server at a time. We are showing 10 items per page.Since we need to paginate to larger datasets we need to keep the ng-repeat model to always contain 50 items for

Angular UI slider with Require JS fires before jQuery UI

人盡茶涼 提交于 2019-12-10 00:14:42
问题 I am building an AngularJS application using RequireJs, AngularUI and jQuery UI. I occasionally get the following error when using the slider: TypeError: Object [object Object] has no method 'slider' at init (http://example.com/Assets/js/lib/angular-ui/slider.js?v=635137928871837150:18:29) at ngModel.$render (http://example.com/Assets/js/lib/angular-ui/slider.js?v=635137928871837150:55:25) at Object. (http://example.com/Assets/js/lib/angular-1.0.7/angular.min.js?v=635137928871837150:140:131)

Change Angular ui-bootstrap datepicker day order

こ雲淡風輕ζ 提交于 2019-12-09 19:39:49
问题 Currently the ui-bootstrap datepicker popup orders the days of the week Mon-Sun. I have a request from a customer to reorder them Sun-Sat Interestingly, on the ui-bootstrap page, the inline example has the Sun-Mon order but the popup is Mon-Sun. Is there a way to change the day order in the popup? I have not found any info on that topic in my googling. 回答1: Andrew, in the Datepicker docs, under the "Popup Settings" subheading, it says "Options for datepicker can be passed as JSON using the

Angular UI Modal with high z-index not on top

萝らか妹 提交于 2019-12-09 19:10:12
问题 In this plunk I have an Angular UI Modal with a z-index larger than a div z-index, however the div is covering the modal. If you click on the div, you'll see that the modal is behind. Since the z-index of the modal is larger, I expect it to be on top of the div. How can this be fixed? HTML <div class="div1" ng-click="hide()" ng-show="show" > CLICK ME </div> <script type="text/ng-template" id="myModalContent.html"> <div class="modal-header" ng-style="{'z-index': 99000}"> <h4 class="modal-title

How to inject '$modalInstance' into a controller?

a 夏天 提交于 2019-12-09 15:59:08
问题 In my application after I found out that a user is not logged in I want to open a modal dialog: .when('/showtask/:id', {templateUrl: 'Home/Template/showtask', resolve: ShowTaskCtrl.resolve, access: { allowAnonymous: false }, resolve: { userAuthenticated: ["$http", "$q", function ($http, $q) { var deferred = $q.defer(); $http.get('/api/Authentication/UserAuthenticated').then(function (data) { if (data.data != "null") { deferred.resolve(data.data); } else { var modalInstance = { templateUrl:

AngularUI Router: pass url params to 'abstract' state while calling child state

百般思念 提交于 2019-12-09 15:39:41
问题 I want to access the url parameter($stateParam) inside a abstract state while calling a child state. I am curious to know how that can be done. Code in plunker also $stateProvider .state('contacts', { abstract: true, //my whole point is to get the id=1 here :( url: '/contacts/:id', templateUrl: function($stateParams){ console.log("Did i get the child's parameter here? " + $stateParams.id) return 'contacts' + $stateParams.id + '.html'; //this will have a ui-view in it which will render its