angularjs-ng-repeat

How to retain the scroll position of ng-repeat in AngularJS when removing an item from the top

不问归期 提交于 2019-12-05 05:39:25
I tried to work from the solution to this How to retain scroll position of ng-repeat in AngularJS? to achieve retaining the scroll position when removing the top item in an ng-repeat but couldn't figure out the code to do so. Also, side note, the list should print in the same order as the items array, not in the reverse as the example does. The solution's code: angular.module("Demo", []) .controller("DemoCtrl", function($scope) { $scope.items = []; for (var i = 0; i < 10; i++) { $scope.items[i] = { id: i, name: 'item ' + i }; } $scope.addNewItem = function() { $scope.items = $scope.items

CSS3 Animation with AngularJS not sliding correctly in Firefox

陌路散爱 提交于 2019-12-05 05:09:26
I made a CSS3 animation connected to an ng-repeat which then shows an inline-list with Bootstrap3, I limited the number of maximum 3 of the list showing and I have some little issues with appears mostly in Firefox (believe it or not IE11 is without issues, wow I was surprised). I have 2 buttons (previous/next) and when I click the Next button then the animation of sliding from left to right start to do his job, but in Firefox when clicking multiple times, it seems that the animation only works on 2/3 of the list (basically the last item on the right always show up first without even sliding

Angular.js updating SVG templates in directives

做~自己de王妃 提交于 2019-12-05 03:07:21
问题 A while ago I asked about "Angular.js rendering SVG templates in directives", where I was replacing the DOM nodes that angular makes when rendering templates, with SVG nodes. I got a response that answered it for me, but I realized that I lost all the databindings from angular. See Plunkr (click update): http://plnkr.co/edit/HjOpqc?p=preview How do I replace these DOM nodes with SVG nodes, and leave my angular bindings intact? I tried using $compile to make it work (as I've done with regular

Bound Input gets unfocused in angularjs

旧城冷巷雨未停 提交于 2019-12-05 02:44:31
问题 I am running this simple code with angularjs : HTML : <div ng-app ng-controller="AController"> <code>{{ itemsInArray }}</code> <div ng-repeat="item in itemsInArray"> <input ng-model="itemsInArray[$index]" /> </div> </div> JavaScript : function AController($scope) { $scope.itemsInArray = ["strA", "strB", "strC"]; } Binding appears to be working correctly when indexing into the array but after entering one character the input loses focus. You can find the working code here on this fiddle : http

How to dynamically disable a filter inside ng-repeat

不打扰是莪最后的温柔 提交于 2019-12-05 02:10:31
问题 It is possible to remove filter using a checkbox? If checkboxes are checked, filters inside ng-repeat would be disabled. For example, if the checkboxes countryfilter and winetypefilter are checked, the related filters would be disabled. Original code (filters enabled) <li ng-repeat="wine in wines | winetypefilter:winetypes| countryfilter:countrytypes | stylefilter:styletypes"> {{wine.name}} is a {{wine.type}} with {{wine.style}} style from {{wine.country}} </li> (filters disabled with the

ng-repeat code getting commented out when viewed from browser

ぃ、小莉子 提交于 2019-12-05 02:03:44
问题 I see during load that the scope element $scope.docDetails has the necessary data. In the view when I use the ng-repeat to print info, I see that it is not displayed in browser. <body ng-controller="documentUploadController" nv-file-drop="" uploader="uploader" filters="queueLimit, customFilter"> <div class="container"> <div ng-repeat="row in documentUploadController.docDetails"> <div class="col-sm-2">{{row.DocumentTypeName}}</div> <div class="col-sm-3 elementwrap"><a href="#" ng-click=

Fixed header table in AngularJS

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 01:36:42
I'm stuck on a problem involving a fixed header table. I'm using AngularJS & Bootstrap to build a web application. I can't use ng-grid as it doesn't support IE7. So, I'm populating the table rows by ng-repeat . The application is responsive . So, I can't give fixed width to the cells/headers. Is there any simple way to have the table headers fixed? I've put up a Plunker at Fixed header table with AngularJS Thanks in advance. I created a directive for this recently, you can install it using bower: bower install angu-fixed-header-table For more details and a working example you can see my blog

$sce:itype Attempted to trust a non-string value in a content requiring a string: Context: resourceUrl

不打扰是莪最后的温柔 提交于 2019-12-05 00:43:37
问题 I want to play songs stored in my sails server. Path is http://localhost:4000/images/123.mp3 . In front end, i'm using ng-repeat to list that songs from server. <div ng-repeat="tones in ringTones track by $index"> <div> <i ng-show="playpause" class="fa fa-play-circle" ng-click="playpause=!playpause" onclick="plays(event);"><audio id="audio_{{$index}}" ng-src="tones.tonePath"></audio></i> <i ng-show="!playpause" class="fa fa-pause" ng-click="playpause=!playpause" onclick="stop(event);"></i><

AngularJS ng-repeat in Bootstrap multiselect dropdown

霸气de小男生 提交于 2019-12-05 00:34:12
I used Bootstrap Multiselect Dropdown http://davidstutz.github.io/bootstrap-multiselect/ & embed into the sub-template of AngularJS & let it run with the following function: $scope.$on('$viewContentLoaded', function () { $(document).ready(function() { $('#example27').multiselect({ includeSelectAllOption: true }); }); }); I continued using ng-repeat to print the inside options of this input select: <select id="example27" multiple="multiple"> <option ng-repeat="list in lists" value="{{list.id}}">{{list.name}}</option> </select> But when ng-repeat is in this input select, it did not work & didn't

How to remove item from array with filter in AngularJS?

我只是一个虾纸丫 提交于 2019-12-05 00:34:05
When I click on tr without any filter, my function array.splice() works. Indexes in the array are in the correct order, so the array.splice() works. When the filter is enable, Indexes in the array are not updated and still in the same order. So array.splice() removes the wrong item. <span ng-click="orderP0 = 'statut_name'; reversePO=!reversePO">order</span> <tr ng-repeat="project in projects | orderBy : orderPO : reverse track by $index" ng-click="remove($event,$index,projects)"> <span class="label" ng-bind="project.statut_name"></span> </tr> $scope.remove = function($event,index,array){ array