angular-ui

Angular UI Router issue when redirecting to a template after resolve() throws error

折月煮酒 提交于 2019-12-31 02:23:05
问题 So It took me a very long time to understand this issue and get to a mcve. Here is the case : I'm trying to redirect a user to a login page when he's not authenticated (this is very basic). Here is the code : HTML : <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.6/angular.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.13/angular-ui-router.min.js"></script> <script src="js/app.js"></script> </head> <body ng-app=

Three level nested routes in angular-ui-router

不打扰是莪最后的温柔 提交于 2019-12-30 05:54:08
问题 Im trying to get my nested route working but it's giving me hard time for two days now :( one level works fine two levels works fine three levels is not working! can anybody please help me out? Thanks in advance angular.module('settings', []).config(['$stateProvider', '$routeProvider', '$urlRouterProvider', function($stateProvider, $routeProvider, $urlRouterProvider) { $stateProvider .state('settings', { url: '/settings', template:"Settings", controller: function(){ console.log('settings'); }

how to show html on pop over using angular ui bootstrap?

强颜欢笑 提交于 2019-12-30 05:48:06
问题 I make demo of pop over like this .It show a pop over on right side when I click the button .But now problem is that how I will show some html on pop over . <html ng-app="plunker"> <head> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.js"></script> <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js"></script> <script src="example.js"></script> <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet"> </head>

How to add guid regex in angular ui-router state

蓝咒 提交于 2019-12-30 05:28:10
问题 I have this route .state('mystate', { url: '/{id}', templateUrl: '/views/partial.html' }); The id param should be a guid in form like this "2a542f61-5fff-4607-845d-972e6c3ad1e4". How do i add this in the url "url: '/{id:?what should i put here}'". 回答1: You can define your own type of parameter. var GUID_REGEXP = /^[a-f\d]{8}-([a-f\d]{4}-){3}[a-f\d]{12}$/i; $urlMatcherFactoryProvider.type('guid', { encode: angular.identity, decode: angular.identity, is: function(item) { return GUID_REGEXP.test

Angular ngGrid select row on page load

两盒软妹~` 提交于 2019-12-30 04:04:08
问题 My question is an extension to thisquestion Getting select rows from ng-grid? plunker - http://plnkr.co/edit/DiDitL?p=preview I need a row to be selected on page load and I need to avoid listening to 'ngGridEventData' calling $scope.gridOptions.selectRow(2, true); in the controller body fails since the grid has not been loaded. avoiding listening to ngGridEventData is due to the fact that I need the controller to listen to an event triggered before and based on that I need to select the

Angular ngGrid select row on page load

瘦欲@ 提交于 2019-12-30 04:04:06
问题 My question is an extension to thisquestion Getting select rows from ng-grid? plunker - http://plnkr.co/edit/DiDitL?p=preview I need a row to be selected on page load and I need to avoid listening to 'ngGridEventData' calling $scope.gridOptions.selectRow(2, true); in the controller body fails since the grid has not been loaded. avoiding listening to ngGridEventData is due to the fact that I need the controller to listen to an event triggered before and based on that I need to select the

Datepicker not opening twice in angular-ui version 0.11.0

佐手、 提交于 2019-12-30 00:27:15
问题 I am trying to have 2 datepickers and I am using Angular UI version 0.11.0. My HTML code <span ng-if="periods.period == 10"> <input type="text" datepicker-popup="dd-MMMM-yyyy" ng-model="cdate.customStartDate" is-open="opened1" max-date="maxDate" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" class="input-md" /> <button class="btn" ng-click="open($event,'opened1')"><span class="glyphicon glyphicon-calendar"></span></button> </span>

Angular-ui modal, sending data into modal controller from $http

倖福魔咒の 提交于 2019-12-29 14:21:37
问题 I'm using the angular-ui modal directive http://angular-ui.github.io/bootstrap/ . I have followed the example from the link above. This is my data I want to send from my controller: ProductsFactory.getOneProduct().then(function(d){ $scope.selectedProduct = d.data; }); $scope.open = function () { var modalInstance = $modal.open({ controller: 'ModalInstanceCtrl', templateUrl: 'productDetail.html', resolve: { items: function () { return $scope.selectedProduct; } } }); }; And this is my modal

Angular-ui modal, sending data into modal controller from $http

試著忘記壹切 提交于 2019-12-29 14:20:56
问题 I'm using the angular-ui modal directive http://angular-ui.github.io/bootstrap/ . I have followed the example from the link above. This is my data I want to send from my controller: ProductsFactory.getOneProduct().then(function(d){ $scope.selectedProduct = d.data; }); $scope.open = function () { var modalInstance = $modal.open({ controller: 'ModalInstanceCtrl', templateUrl: 'productDetail.html', resolve: { items: function () { return $scope.selectedProduct; } } }); }; And this is my modal

Angular-UI One day is subtracted from date in ui-date

北慕城南 提交于 2019-12-28 18:38:51
问题 The situation I want to use ui-date to set/edit a date in my app. I use the latest stable versions of angular, angular-ui, jquery-ui etc. The problem As soon as a date is selected using the datepicker the date in my model will equal the selected date minus 1 day. It will also get send to my server and saved in my database this way. The plunker http://plnkr.co/edit/Ft14Wa?p=preview Initially the date in the datepicker input and the date in my model are the same. After picking a date they