angular-ui

Responsive dropdown navbar with angular-ui bootstrap (done in the correct angular kind of way)

落爺英雄遲暮 提交于 2019-12-28 04:39:07
问题 I've created a JSFiddle with a dropdown navbar using angular-ui-boostrap's module "ui.bootstrap.dropdownToggle": http://jsfiddle.net/mhu23/2pmz5/ <div class="navbar navbar-fixed-top"> <div class="navbar-inner"> <div class="container"> <a class="brand" href="#"> My Responsive NavBar </a> <ul class="nav"> <li class="divider-vertical"></li> <li class="dropdown"> <a href="#" class="dropdown-toggle"> Menu 1 <b class="caret"></b> </a> <ul class="dropdown-menu"> <li><a href="#/list">Entry 1</a> </li

How to detect browser using angularjs?

这一生的挚爱 提交于 2019-12-28 03:30:13
问题 I am new to angularjs. How can I detect userAgent in angularjs. Is it possible to use that in controller? Tried something like below but no luck! var browserVersion = int((/msie (\d+)/.exec(lowercase(navigator.userAgent)) || [])[1]); I need to detect IE9 specifically! 回答1: Like Eliran Malka asked, why do you need to check for IE 9? Detecting browser make and version is generally a bad smell. This generally means that you there is a bigger problem with the code if you need JavaScript to detect

Scope issue in AngularJS using AngularUI Bootstrap Modal

笑着哭i 提交于 2019-12-27 17:09:12
问题 plunker: http://plnkr.co/edit/wURNg8ByPYbEuQSL4xwg example.js: angular.module('plunker', ['ui.bootstrap']); var ModalDemoCtrl = function ($scope, $modal) { $scope.open = function () { var modalInstance = $modal.open({ templateUrl: 'modal.html', controller: 'ModalInstanceCtrl' }); }; }; var ModalInstanceCtrl = function ($scope, $modalInstance) { $scope.ok = function () { alert($scope.text); }; $scope.cancel = function () { $modalInstance.dismiss('cancel'); }; }; index.html: <!doctype html>

How to use a keypress event in AngularJS?

白昼怎懂夜的黑 提交于 2019-12-27 09:01:22
问题 I want to catch the enter key press event on the textbox below. To make it more clear I am using a ng-repeat to populate the tbody. Here is the HTML: <td><input type="number" id="closeqty{{$index}}" class="pagination-right closefield" data-ng-model="closeqtymodel" data-ng-change="change($index)" required placeholder="{{item.closeMeasure}}" /></td> This is my module: angular.module('components', ['ngResource']); I am using a resource to populate the table and my controller code is: function

Unable to access model values for the angular ui modal dialog

人盡茶涼 提交于 2019-12-25 18:05:42
问题 I am very new to the angular world (second day) and trying to work around angular ui. I am trying to build my first modal dialog. The modal dialog is being shown properly but I m not able to use model in that modal dialog. Here is my demo plunker Here is what I've done so far: In controller: appRoot.controller('DemoCtrl', function ($scope, $modal) { $scope.openDemoModal= function (size) { var modalInstance = $modal.open({ templateUrl: 'ngPartials/_DemoModal.html', controller: 'modalCtrl',

Refresh Events In Angular Calendar UI (Fullcalendar) With Laravel As A Backend

你离开我真会死。 提交于 2019-12-25 16:51:38
问题 I am trying to make an automated refresh calendar. I am using Calendar UI and i am getting data from my backend in this way /**Calendar Config***/ //config object $scope.uiConfig = { calendar:{ height: 500, width: 800, editable: false, //First Hour firstHour: 8, //Devide by half hour slotMinutes: 30, //default duration 01:30 defaultEventMinutes: 90, axisFormat: 'HH:mm', timeFormat: { agenda: 'H:mm{ - H:mm}' }, header:{ //Buttons center: 'month agendaWeek agendaDay', left: 'title', right:

How to update AngularJS view when the value has not changed?

落花浮王杯 提交于 2019-12-25 11:44:05
问题 In my view I diplay a photo from the user's profile, in my view I have: <img src="{{user.photo.pathRelative}}"/><br/> When user uploads new photo it is uploaded to the server and the picture at the path is updated. The result is that the data of the picture is changed, however, the user.photo.pathRelative stays the same. This is the reason why the picture in the view does not change. Any ideas how I can enforce the view to refresh the picture even if the value on the model is not changed (but

ui cell template needs dynamic ng style

萝らか妹 提交于 2019-12-25 07:59:48
问题 In angularjs ui grid, I have the cell template as shown below : cellTemplate : "<div class="progress"> <div class="progress-bar progress-bar-info" ></div> </div>" Now I need to dynamically change the color class for the cellTemplate i.e., progress-bar-info . Based column value (complete, incomplete, in progress or fail) I need to have progress-bar-success, progress-bar-info, progress-bar-warning, progress-bar-danger in the cellTemplate. How can we achieve it? I tried the following template

How to communicate between controllers while not using SharedService between them?

跟風遠走 提交于 2019-12-25 03:55:35
问题 I was reading all the answers about communication between controllers and directive, but is seems to me occurred using shared service and inject it to each one of them. When I'm developing a very large scale application, I don't know what my page is going to have in it. I may have 2 controllers need to communicate between them, and I also may have 5 directive and 2 controllers in the same page. I don't know from scratch what is going to be inside my view/page, so I need a better way how to

How to communicate between controllers while not using SharedService between them?

微笑、不失礼 提交于 2019-12-25 03:55:03
问题 I was reading all the answers about communication between controllers and directive, but is seems to me occurred using shared service and inject it to each one of them. When I'm developing a very large scale application, I don't know what my page is going to have in it. I may have 2 controllers need to communicate between them, and I also may have 5 directive and 2 controllers in the same page. I don't know from scratch what is going to be inside my view/page, so I need a better way how to