angularjs-ng-repeat

AngularJS: Memory Leak with ng-repeat using custom objects (w/simple PLUNKR)

女生的网名这么多〃 提交于 2019-12-03 20:50:34
问题 (simple plunkr demo here) SUMMARY: There is a leak using ng-repeat after the 2nd wave iterating over an 'array' of custom objects like this : <div ng-repeat="d_sampleObject in mySampleObjects"> {{d_sampleObject.description}} </div> Memory profile reveals an extra 'd_sampleObject' left over and not de-referenced. More details (via a controller and an injected service) below. A simple demonstration also in the provided plunkr link. Any thoughts and help greatly appreciated in advance! NOTE:

AngularJS filtering between a range

孤人 提交于 2019-12-03 17:59:49
问题 I have set up a range slider that ranges from 0 - 2hr, the times are calculated in mins then converted to hh:mm like this: 10min, 20min, 1hr 20min, 2hr. But now I am trying to filter a bunch of items inside the ng-repeat using the range specified by the range slider and I am having a hard time getting this working. Here is what I have done http://cdpn.io/LDusa I am using http://danielcrisp.github.io/angular-rangeslider/demo/ for the range slider. And here is the code: var app = angular.module

Bound Input gets unfocused in angularjs

岁酱吖の 提交于 2019-12-03 17:33:52
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://jsfiddle.net/QygW8/ I think this is happening because you are manipulating the same item which is

AngularJS - Unknown provider: groupByFilterProvider <- groupByFilter

本小妞迷上赌 提交于 2019-12-03 17:11:25
问题 I have a array of object. I need to group the data by one field and show the result in an HTML table. INPUT : [ { id: "559e2bbc9a496034557d6d84", text: "Data Sources", topParentId: "559e2bbc9a496034557d6d84", topParentText: "Data Sources" }, { id: "559e2bbc9a496034557d6d83", text: "Applications", topParentId: "559e2bbc9a496034557d6d83", topParentText: "Applications" }, { id: "559e2bbc9a496034557d6d82", text: "Analytics", topParentId: "559e2bbc9a496034557d6d83", topParentText: "Applications" }

$index of Object in Array while using ng-repeat and a filter

≯℡__Kan透↙ 提交于 2019-12-03 17:07:25
问题 Im fairly new to angular and have been able to get around somewhat. But I cant seem to find the answer to this scenario... I have an array of objects, which I am pulling down from firebase. I am using an ng-repeat for the objects, then displaying data accordingly. I am trying to pass the index as a routeparam to an "edit" controller. In which case I would like to pull the object data as one would anticipate. However, when I filter the ng-repeat I am getting the index of the filtered content.

How to dynamically disable a filter inside ng-repeat

爱⌒轻易说出口 提交于 2019-12-03 16:58:48
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 checkboxes, countryfilter and winetypefilter ) Would result: <li ng-repeat="wine in wines | stylefilter

Angular JS Fails After Upgrade from 1.1.0 to 1.1.1

守給你的承諾、 提交于 2019-12-03 16:55:56
When I upgrade the the ng-repeat takes extraordinarily long to load and tries to display MORE content boxes without the content that is being served by $resource. I have narrowed the problem down to the update between 1.1.0 and 1.1.1. I looked through the changelog but nothing popped out at me to be the culprit, but it must be in there. Changelog => https://github.com/angular/angular.js/blob/master/CHANGELOG.md#111-pathological-kerning-2012-11-26 The repository for this app => https://github.com/brianpetro/resume Currently my angular looks like: app = angular.module("Resume", ["ngResource"])

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

人盡茶涼 提交于 2019-12-03 15:59:43
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></div> </div> This audio source cause external resource problem <audio ng-src="tones.tonePath"></audio> in

Can I avoid the object variable name in ng-repeat loop?

北战南征 提交于 2019-12-03 15:04:45
When defining an ng-repeat directive to iterate over an array, the syntax specifies ng-repeat="friend in friends" , and then within the template you use the interoplation operator like so {{friend.name}} . Is it possible to have the properties assigned to the current item scope, rather than a variable in it? So I could call just {{name}} instead of {{friend.name}} ? The reason being is that my directive is being used in the scope of two different templates - for example I might have a directive "userActions" that is used in both a repeater, and also inside an unrelated template where {{friend

Group ng-repeat items

孤街浪徒 提交于 2019-12-03 15:01:43
I have an array of items items . I would like to use the ng-repeat directive or something similar, to group n items together. For instance: I would like items=['a', 'b', 'c', 'd', 'e', 'f', 'g'] to be rendered in groups of 3 to be rendered as: <div class="row"> <div class="col-sm-4">a</div> <div class="col-sm-4">b</div> <div class="col-sm-4">c</div> </div> <div class="row"> <div class="col-sm-4">d</div> <div class="col-sm-4">e</div> <div class="col-sm-4">f</div> </div> <div class="row"> <div class="col-sm-4">g</div> </div> I know I could do some processing to turn items into items=[['a', 'b',