angular-ui

How to reload the current state?

99封情书 提交于 2019-12-16 20:32:53
问题 I'm using Angular UI Router and would like to reload the current state and refresh all data / re-run the controllers for the current state and it's parent. I have 3 state levels: directory.organisations.details directory.organisations contains a table with a list of organisations. Clicking on an item in the table loads directory.organisations.details with $StateParams passing the ID of the item. So in the details state I load the details for this item, edit them and then save data. All fine

Setting options to datepicker in angular-ui bootstrap

痴心易碎 提交于 2019-12-14 03:47:08
问题 I'm trying to use datepicker component from angular-ui bootstrap lib as descibed here: http://angular-ui.github.io/bootstrap/ And I try to set options for the popup picker and accoriding to the documentation I should pass options for datepicker as JSON using the datepicker-options attribute. In my view I have: <div class="row"> <div class="col-md-6"> <p class="input-group"> <input type="text" class="form-control" datepicker-popup="{{format}}" ng-model="dt" is-open="opened" min="minDate" max="

How to set default URL/route?

不想你离开。 提交于 2019-12-14 00:21:51
问题 I'm implementing AngularUI's routing and appear to be missing something about how to configure a default URL. It seems like the below code would default the user to /dashboard/tree but if I refresh the page, the url appends another /dashboard , so I end up with /dashboard/dashboard/dashboard/dashboard/tree . How can I properly set the default URL without having this appending issue when the user first visits the page? config(['$urlRouterProvider', '$stateProvider', function($urlRouterProvider

AngularJs: grab compiled html and set into tooltip

a 夏天 提交于 2019-12-13 20:04:06
问题 I'm using angular js bootstrap tooltip to show tooltips on a set of elements. Plunker: http://plnkr.co/edit/9xk41f3CR0wnajN71bSi I need to inject into the tooltip html compiled by angular, but i don't really get how. The tooltip tutorial is not useful to me because it gets the html from the scope as variable, but for a set of elements this is not possible. How can i fill tooltip-html-unsafe ? 回答1: You can do something like this: HTML: <li ng-repeat="phone in phones"> <div phone-info index="{{

AngularUI DatePicker - JavaScript - Date one day off when getting SQL Date format

谁说我不能喝 提交于 2019-12-13 18:37:09
问题 I load in a SQL format date into a variable "2014-02-28" , but when I create a new Date("2014-02-28"); the Date displayed in the input box is: 2014-02-27 In the AngularUI datepicker, the date is always one day off even if the value is correct in the model. Is there some way to remedy this? Here is a Plunkr link which demonstrates the problem: http://plnkr.co/edit/evBwPW0KO7cEWGp6vqtk?p=preview I would like the model to be just the date in yyyy-MM-dd format, and for the date to be correct. 回答1

Display Loading Icon or Loading Progress Bar using angularjs

Deadly 提交于 2019-12-13 12:29:18
问题 How to display the loading Icon or loading Progress bar using angularjs. I mean something like this which used in jquery $("body").addClass("loading"); , $("body").removeClass("loading"); , I saw some links for progress bar which is of like youtube loading bar but i don't want like that I want simple progress bar or loading iage or loading icon or loading bar which show bar moving from module to module, tabs to tabs. Is there any link or function which explain clearly how to use it. 回答1: if

AngularJS - “Error: Template must have exactly one root element” when using Angular-UI Typeahead

感情迁移 提交于 2019-12-13 12:06:54
问题 I'm using AngularUI Typeahead, on the 'index' page of my app. I'm not doing anything fancy - in fact, I'm just trying to get the example they've got up on their UI site working, and I'm getting this error: Error: Template must have exactly one root element I have no idea what this means, but it only happens when I have the following code: <input type="text" ng-model="selected" typeahead="state for state in states | filter:$viewValue"> If relevant, my controller for my main page (which is

How to position popover over a highlighted portion of text?

蓝咒 提交于 2019-12-13 11:35:42
问题 Assume this scenario where there is a body of text. And, on highlighting a word from it, I want a popover to show up with the tooltip positioned at the highlighted word. Kind of like how mac shows definitions of words like below - It's an angularjs application, and am using angularui. So, an angular ui focussed solution would be preferable but not necessary. Thanks in advance. 回答1: You can use following code to get do what you want to do... Good Luck: <html> <head> <script src="https://ajax

When '/' is used for url of a parent state two slashes appear in url

房东的猫 提交于 2019-12-13 07:38:45
问题 Update: My assumption was wrong. I expected that urls represent components of the path with corresponding combination in a way how final path is usually produced. But urls are just concatenated, nothing more. I have the following states: .state('banksList', { url: '/', ... }) .state('banksList.bank', { url: '/bank/{bankId}', ... }) .state('banksList.bank.branch', { url: '/branch/{branchId}', ... }) After transition to banksList.bank browser shows http://bla-bla//bank/1 , and base tag points

Can't pass Fullcalendar options through the directive in AngularJS

不问归期 提交于 2019-12-13 07:13:22
问题 I trying to implement a simple example with AngularJS Fullcalendar direcive from here: https://github.com/angular-ui/ui-calendar It doesn't display any event neither apply custom FullCalendar settings and no error are shown, what am I doing wrong? And my code is following: <!DOCTYPE html> <html data-ng-app="foodViewApp"> <head lang="en"> <meta charset="UTF-8"> <title>AngularJS Tutorial</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">