angularjs-ng-repeat

How to delay ngAnimate in ngRepeat

亡梦爱人 提交于 2019-12-02 16:19:43
When using ngAnimate to fade in each item in ngRepeat, currently all items fade in at the same time. Is it possible for each item to fade in after the previous item has faded to e.g. 50% resulting in a cascading effect? <ul> <li ng-repeat="phone in phones" ng-animate="{enter: 'phone-fade-enter'}"> <img src="{{phone.img}}"> {{phone.name}} </li> </ul> Using ngAnimate it would be nice if it would be possible to delay the animation of each item e.g. like this: <li ng-repeat="phone in phones" ng-animate="{enter: 'phone-enter', delay: 500}"> Is there a way to solve this? Thanks! Added to GitHub

How to change class depending on filter result in AngularJS?

和自甴很熟 提交于 2019-12-02 16:13:31
问题 I cannot work out how to change the style of a class depending on the status/result of the filter. My code: <div data-ng-if="search.length >= 3" > <div data-ng-class="{list:true}" style="margin-top: 30px;"> <a class="item item_recipe" data-ng-repeat="item in items | nonBlankFilter:search | filter:search" data-ng-click="$emit('search.click',item.PK);"> <img class="thumbnail" src="images/thumbnails/{{item.THUMB}}"> <div class="title">{{item.TITLE}}</div> </a> </div> What is happening now, is

AngularJS ng-repeat, comma separated with 'and' before the last item

北战南征 提交于 2019-12-02 16:12:35
I have a list of items ... $scope.Users =[{ UserName: '' }]; In my view I want to list them like this assuming I have only 4 items in my $scope:Users Username1, Username2, Username3 and Username4 <span data-ng-repeat="user in Users">{{user.Username}}</span>{{$last ? '' : ', '}} The above expression will basically add comma after each item and works fine. My problem is how do I add an and keyword before the last item so it will be like: Username1, Username2, Username3 and Username4 instead of: Username1, Username2, Username3, Username4 $last is the truthy value.. so it holds either true or

ng-repeat with empty objects

余生长醉 提交于 2019-12-02 13:53:17
问题 I'm getting a 'Duplicates in repeater' error. I read somewhere that I can track by index, but as soon as I do that all my object title and description values become duplicated. I need to define unique titles, descriptions and asset arrays for each individual step. How can I do this? var stepTemplate = { assets:[] } $scope.item.steps = [stepTemplate]; $scope.addRow = function(){ $scope.item.steps.push(stepTemplate); $log.debug('row added') } $scope.deleteRow = function(index){ $scope.item

Use href in an AngularJS ng-repeat div

泄露秘密 提交于 2019-12-02 12:25:39
I'm trying to insert a href link inside a div that uses ng-repeat. This href link needs to be different from each div created with ng-repeat, its value being part of AngularJS $scope variable. Here is my JS code: var app = angular.module('test', []); app.controller('MainCtrl', function($scope) { var database = firebase.database(); database.ref(`trips/${userid}/trips`).once('value') // will return you all the photo objects inside the `tripId` .then(photosSnap => { var trips = []; photosSnap.forEach((trip) => { trips.push({ tripKey: trip.key, tripName: trip.val().name, tripPhotoUrl: trip.val()

trigger function after ng-repeat

寵の児 提交于 2019-12-02 11:19:44
I am new to Angular, and I would like to do a really basic example. After displaying some data with a ng-repeat , I would like to use some of those data with javascript functions. But I don't know when to execute the javascript, because I don't when angular will finish to display my data. Here is a fiddle: I try to show an alert with the function getAssign3 some data displayed by Angular. When should I call this function ? Code: <div ng-app="Test"> <h1>Results Table</h1> <div ng-controller="AssignmentCtrl"> <span ng-repeat="assign in assignments"> <span id="{{assign.id}}">{{assign.title}}<

Angular ng-repeat filter on subarray

时光毁灭记忆、已成空白 提交于 2019-12-02 11:14:11
问题 Using Angular, I'm trying to filter using ng-repeat on FactorName given the following schema. Filtering using <... ng-model="query.Factors.FactorName" ...> doesn't work (not surprisingly). I haven't seen literature on anyone trying to filter in this way. Does Angular support filtering based on a subarray element property ? [ { "Name":"1", "Factors":[ { "FactorName":"FactorOne", "Type":"SomeType" }, { "FactorName":"FactorTwo", "Type":"SomeType" } ] }, { "Name":"2", "Factors":[ { "FactorName":

How to reach variable outside the ng-repeat scope

两盒软妹~` 提交于 2019-12-02 10:23:50
Is possible to reach variable outside the ng-repeat scope? jsfiddle: http://jsfiddle.net/zcbhubrw/ Here is the code: HTML <div class="section" ng-app="phonecatApp" ng-controller="PhoneListCtrl"> <div class="slide" > <div class="container"> <h2 class="section-title">Selected Mobiles</h2> </div> <div class="container-fluid fix ver2"> <div class="col-md-3 work-thumb" ng-repeat="phone in phones"> <a href="#" ng-click="count = {{$index}}"> {{phone.name}} </a> </div> </div> </div> <p>Count: {{count}}</p> </div> Controller var phonecatApp = angular.module('phonecatApp', []); phonecatApp.controller(

how to use filter on button click in angular js

拈花ヽ惹草 提交于 2019-12-02 09:37:56
问题 could you please tell me how to sort array in ascending or descending order on button click .Actually I have a button on header "V" .using button click I want to display data in ascending order .Actually I am making a grid view in Ionic using angular js .But I want to sort that using button click .I need to sort table according to first column .Because user click on first column "V". here is my code http://plnkr.co/edit/UloVItuyLLvmeo34R4gX?p=preview Expected result after button click Calls

How to Pass the data from Main Window to Child Window to display large data in table using AngulaJS

我与影子孤独终老i 提交于 2019-12-02 09:32:19
Hi Currently my main intention of the question is avoid displaying large data in the <td></td> . So instead of that I want to display the data in the new window by clicking on the element of the table. Currently I am displaying the table using the AngularJS. I have done much research but not able to get the output. I want in the similar way as show in this link, But instead of getting the value from Input box I want to get the value from ng-repeat in the td cell and ,when the cell is clicked new window should be popped up Passing Data to New window Tutorial Below is the demo of the my table