ng-repeat

AngularJS ng-repeat and Packery.js

风格不统一 提交于 2019-12-14 03:01:10
问题 I am trying to implement packery in an angularJS application. When I define the items manually one by one (see the commented html code), Packery works fine. When I try to do the same thing with an ng-repeat loop, packery does not work. How can I make packery work with ng-repeat in an angularJS template? The template: <div class="item-container" workspace> <div class="module-sizer"></div> <div class="gutter-sizer"></div> <div ng-repeat="item in items" class="item"> <!--my {{angular content}}

angular js ng-repeat a radio button list from scope with a default checked

主宰稳场 提交于 2019-12-14 01:29:57
问题 app.controller('radiusController', function($scope){ $scope.radii = [ {id:.25, checked:"false", name:"1/4 Mile"}, {id:.5, checked:"false", name:"1/2 Mile"}, {id:1, checked:"false", name:"1 Mile"}, {id:2, checked:"true", name:"2 Mile"}, {id:3, checked:"false", name:"3 Mile"}, {id:4, checked:"false", name:"4 Mile"}, {id:5, checked:"false", name:"5 Mile"} ]; $scope.handleRadioClick = function(radius){ window.radiochecked = radius.id; }; }); <li ng-repeat="radius in radii" id="selectradius-{

angularjs ng-repeat on two levels but just one output

懵懂的女人 提交于 2019-12-14 01:18:49
问题 I have a big object that looks something like this : scope.marketplaces = { first_example : { ... }, second_example : { ... }, ... }; What I'm trying to do is loop through the big object like this : <section> <ul> <li ng-repeat="(key, value) in marketplaces"></li> </ul> </section> And inside the loop, loop again each object, but instead of appending to DOM something like : <li> ... first level loop ... <li> ... second level loop ... </li> </li> I would like to have just one <li></li> despite

Why does adding an ng-repeat to my AngularJS template break it?

穿精又带淫゛_ 提交于 2019-12-13 08:29:36
问题 I have an AngularJS directive whose template file looks like this: path/to/myDirectiveA.template.html : <tr> <td bgcolor='#7cfc00'>Statement</td> <td bgcolor='#ff1493'>{{MyDirectiveACtrl.a.b}}</td> </tr> It works. The output looks like this: But then I change the template file by adding an ng-repeat like this: <tr ng-repeat="currRow in [0, 1, 2, 3]"> <td bgcolor='#7cfc00'>Statement</td> <td bgcolor='#ff1493'>{{MyDirectiveACtrl.a.b}}</td> <td bgcolor='#7cfc00'>{{currRow}}</td> </tr> And that

deleting an element in ng-repeat with orderBy and track by is failing

主宰稳场 提交于 2019-12-13 05:58:19
问题 Here is the code <tr ng-repeat="collection in collections | orderBy:'-modifiedDate' track by $index" ng-init="listIndex = $index"> If I remove orderBy:'-modifiedDate' , the deletion on a specific element is working great. However, I need the collection/array to be rendered in sorted way that's why I have orderBy. If I don't delete the orderBy:'-modifiedDate' from the code and I delete a random element say on position 7, the element that gets deleted is the very last always. I had to use ng

How to update only specific rows when using ng-repeat

南楼画角 提交于 2019-12-13 05:55:34
问题 I have a UI similar to excel, where the user can change the data in which ever row he wants. Currently i am using ng-repeat to display the existing data, after fetching from mongoDB. This data is an array of Json Objects , so ng-repeat works fine. Now i want to have a single save button, clicking which, all the edits should be saved. My question is how to maintain or know which rows have been changed ?? i can just send the whole array and update in the db, but when the number of rows is large

Editing an item from ng-repeat

两盒软妹~` 提交于 2019-12-13 05:35:11
问题 So far I've been successful in creating a function that removes an element from ng-repeat and to toggle a form. I can't figure out how to edit a given element in that ng-repeat. Ideally, I'd like to click on the element, and have the form show with the existing values already in the input. So that all the user needs to do is edit whichever fields desired, click submit and that newly updated item is then added back to the array where it originally was. This is what I've come up with: <div ng

angular doesn't apply changes to array(remove item on socket event)

你。 提交于 2019-12-13 05:16:15
问题 First of all, sorry for my english, i'm ukrainian When socketio card delete event performed, there is nothing changed in view ng-repeat in my view <card object="item" ng-repeat="item in LOG"></card> In my controller $scope.LOG = [{...},...{...}]; SocketIO emit socket.on('card_was_deleted', function (data) { $scope.open_object = undefined; $scope.LOG = $scope.LOG.filter(function (obj) { return obj.ID != data.id; }); });//or var index = ...;$scope.LOG.splice(index, 1); I was looking for $scope.

How to filter out a user using ng-repeat within firebase and angularfire?

风流意气都作罢 提交于 2019-12-13 05:15:36
问题 The below code pulls an array from firebase using ng-repeat and filters for the userId. The issue is that when I use "!" it does not filter out the user, but instead nothing shows up. In other words when I replace the below ng-repeat filter: ng-repeat="(id,item) in ideas| filter:user.google.id" with this ng-repeat filter, with the intention of filtering out the user, it no longer works. ng-repeat="(id,item) in ideas| filter:user.google.id" How can I filter out list for any item that contains

ng-repeat not update model with track by

笑着哭i 提交于 2019-12-13 02:43:03
问题 I've been using checklist-model to work with an array of check-boxes with each selected one can be deleted. Everything seems to work fine until I use it inside a ng-repeat. The problem is, the deleted check-boxes still be there around when I add the track by $index along with the ng-repeat . If I remove that track by , it works fine (but in my real app I need that track by to work). Here's a plnkr, Demo To see the problem, you can follow these steps. Select any check-box you want Delete those