angularjs-ng-repeat

Can I use Angular variables as the source of an audio tag?

僤鯓⒐⒋嵵緔 提交于 2019-12-21 13:03:09
问题 I am trying to do the following: <div ng-repeat="audio in event.audios"> <audio ng-src="/data/media/{{audio}}" controls></audio> </div> But when I load the view, the {{audio}} variable is not parsed but hardcoded into the source as is. However, if for example, I place that same variable outside of the audio tag it renders the name of the audio file correctly. I've tried using both src and ng-src to no avail. Is there a way to get the variable to work within an audio tag? Thanks in advance.

AngularJs - ngRepeat with a filter that returns a new object

南楼画角 提交于 2019-12-21 10:33:11
问题 I'm trying to apply a transformation to the objects in my filter, which results in an array of new objects being returned. This is because I want to filter the objects AFTER the transformation is applied and display the results of the transformation. However, I end up with an infinite digest because the objects I display are different than the objects I put in (when comparing their $$ids ). My thoughts to solve this are the following: Use a tracking expression like track by item.id and assign

AngularJs - ngRepeat with a filter that returns a new object

懵懂的女人 提交于 2019-12-21 10:33:03
问题 I'm trying to apply a transformation to the objects in my filter, which results in an array of new objects being returned. This is because I want to filter the objects AFTER the transformation is applied and display the results of the transformation. However, I end up with an infinite digest because the objects I display are different than the objects I put in (when comparing their $$ids ). My thoughts to solve this are the following: Use a tracking expression like track by item.id and assign

how to set dynamically height to element?

Deadly 提交于 2019-12-21 07:35:25
问题 I am trying to set dynamically height to element in my demo .I will tell you issue I am taking static or constant value of height in my demo .I take 250px constant value #wrapper{ background-image: url(https://dl.dropboxusercontent.com/s/nz1fzunlqzzz7uo/login_bg.png?dl=0); min-height: 250px; background-repeat: no-repeat; } But I need to add this height dynamically .I got height from this $scope.hgt =$window.innerHeight/3; alert($scope.hgt) But I need to set $scope.hgt to min-height to

Angular get length of filtered ng-repeat

倾然丶 夕夏残阳落幕 提交于 2019-12-21 07:19:09
问题 I have upgraded to Angular 1.2.9 from v 1.0.8 to help with the performance of my app. I have introduced track by which has improved the speed. What I used to have <div class="result row" data-ng-repeat="result in (filteredItems = (results | filter: filterPrice | filter: filterCategories | filter: filterTypes | filter: filterAirConditioning | filter: filterTransmission | filter: filterFourByFour | filter: filterFuelType | filter: filterNumberOfDoors | filter: filterOnAirport | filter:

Angular Js : How to find first and last element in ng-repeat and add special class to them?

核能气质少年 提交于 2019-12-21 06:55:30
问题 I changed the following using angular js <section id="social"> <h2 class="line">Social Profiles</h2> <a href="#" class="first"><i class="icon-facebook"></i></a> <a href="#"><i class="icon-twitter"></i></a> <a href="#"><i class="icon-linkedin"></i></a> <a href="#"><i class="icon-google-plus"></i></a> <a href="#" class="last"><i class="icon-rss"></i></a> <div class="clear"></div> </section> To this <section id="social"> <h2 class="line">Social Profiles</h2> <a ng-repeat="sMedia in socialMedia"

How to Parse JSON response into ng-repeat correctly in Angularjs

独自空忆成欢 提交于 2019-12-21 05:24:15
问题 I want to be able to use ng-repeat in order to parse my response on the front end. I am having trouble parsing responses that have multiple items versus a single item using ng-repeat list. I am able to parse; but I have to create 2 different list with separate ng-repeat configuration on the front end and add some ugly logic to not display if length of array is greater than one. My goal is to have only one ng-repeat element in my partial and it handles both responses or a better approach to

Animating ng-move in AngularJS ngRepeat is animating the wrong items

别说谁变了你拦得住时间么 提交于 2019-12-21 04:02:22
问题 I'm a little flummoxed when it comes to animating ng-move in an ng-repeat. If I move an array item from 3 to 7 for instance, items 4-7 get shifted up and they animate. However the actual item I moved from 3 and placed in position 7, does not. Here's a plunkr demonstrating my issue. http://plnkr.co/edit/4yRkLWbsU57YxrYOrWUQ?p=preview Moving item 7 to 3, however, works as I expect, animating the single moved item, and not the items that have been pushed down. This is not very useful for showing

How to save Firebase objects $asArray() with angularFire, when the objects contain ng-repetate

不羁岁月 提交于 2019-12-21 02:58:26
问题 I recently switched from angularfire 0.6 to to 0.8.0. I am having problems to save an item of a list, that contains an array itself. My Objects account look like this: { "-JQruasomekeys0nrXxH" : { "created" : "2014-03-23T22:00:10.176Z", "durations" : [ { "$$hashKey": "00L", // this is generated by ng-repeat on arrays "end" : "2014-07-15T22:00:00.000Z", "start" : "2014-07-09T22:00:00.000Z" } ], "email" : "some@mail.net", } } The durations are an array of time periods with start and end, which

How can I use ng-click to dynamically reload ng-repeat data?

陌路散爱 提交于 2019-12-20 20:27:13
问题 I have a page that contains an ng-repeat directive. The ng-repeat works when the page first loads, but I want to be able to use ng-click to refresh the contents of the ng-repeat . I have tried the following code but it doesn't work. Any suggestions? <div ng-click="loadItems('1')">Load 1st set of items</div> <div ng-click="loadItems('2')">Load 2nd set of items</div> ... <table> <tr ng-repeat="item in items">> // stuff </tr> </table> ItemsCtrl: $scope.loadItems = function (setID) { $http({ url: