angularjs-ng-repeat

Fancybox directive in ng-repeat is not grouping images

江枫思渺然 提交于 2019-12-23 06:08:06
问题 I am trying to use Fancybox within my app and while the plugin works (it opens the images in the lightbox), it is not recognizing the rel or data-fancybox-group attribute to group multiple images (so that I can navigate through them right in the lightbox). Here is my directive: app.directive('fancybox', function() { return { restrict: 'A', link: function(scope, element) { $(element).fancybox({ theme : 'dark' }); } }; }); And here is how I invoke it on the template: <figure ng-repeat="img in

ng-repeat in repeat does not repeat nested object angular

安稳与你 提交于 2019-12-23 05:11:35
问题 I have a object with categories, inside this object there is a object called items which contain objects with items. now i want to do in a repeat to display the items like this: <div ng-if="delivery_items" ng-repeat="(k, cat_item) in delivery_items"> <div class="item-cat-header"> <i class="fa fa-arrow-circle-right"></i> {{cat_item.item_category_name}} </div> <div class="item-rule" ng-repeat="item in cat_item.items"> <div class="item-info"> {{item.item_name}} <p class="item-desc"></p> </div>

How to append a new value to an item within an array in Firebase?

我是研究僧i 提交于 2019-12-23 04:58:12
问题 Within Firebase, I have a list of 'ideas.' If a user presses a button associated with the idea, I'd like a value to be appended to that idea under an attribute called 'newValue.' For example, the below html, uses ng-repeat to show the array of ideas and creates an associated button called 'Append Value.' I want a new value to be appended to the idea's attribute called 'newValue' every time a user presses 'Append Value.' <body ng-controller="ctrl"> <table> <tr class="item" ng-repeat="(id,item)

AngularJS ng-repeat img ang video

℡╲_俬逩灬. 提交于 2019-12-23 03:22:34
问题 How to implement the idea of ​​a slider showing images and video. How to get repetition via ng-repeat of different data types? I have a list of files: var scr = [ {src: 'img1.png', title: 'Pic 1'}, {src: 'img2.jpg', title: 'Pic 2'}, {src: 'vid1.mp4', title: 'Vid 1'}, {src: 'vid2.mp4', title: 'Vid 2'} ]; Images can be inserted through ng-repeate: <div class="slide" ng-repeat="image in images" ng-show="image.visible"> <img src="./img/slides/{{image.src}}"/> </div> How to insert videos in this

AngularJS : Appending the same structure on the click of each item

房东的猫 提交于 2019-12-23 02:22:39
问题 My index.html page is like following: <div id="sidepanel" ng-controller="myCtrl"> <ul class="drop-down"> <li ng-repeat="item in items"> <a href="#">{{item.name}}</a> </li> </ul> </div> <div id="mainpanel" ng-controller="listCtrl"> <div ng-view></div> </div> For this ng-view I have record-list.html to show all the records which is like following: <div class="container"> <ul class="design"> <li id="{{record.name}}" ng-repeat="record in records"> <div>......</div> </li> </ul> </div> Now i want

Angularjs disabling drop down

一笑奈何 提交于 2019-12-23 01:40:06
问题 I have a ui in which based on the selection of one drop down another dropdown should be disabled. Both these dropdowns are generated using ng-repeat . Below is the code sample <tr data-ng-repeat="abc in xyz.divisionViewList" > <select data-ng-model="abc.selectedAppRole" ng-init="abc.selectedAppRole =abc.selectedAdRole" id="{{abc.applicationId}}_{{abc.divisionId}}" name="{{abc.selectedAppRole}}"> <option value="null">Select/Deselect a role</option> <option data-ng-repeat="roleDetail in abc

ng-repeat only objects with specific property value - custom filter?

ぐ巨炮叔叔 提交于 2019-12-22 12:23:49
问题 So say I have a JSON object 'user' with some basic properties like: 'name', 'address', 'role', etc. I want the ng-repeat to only spit out the objects in which the property 'role' equates to 'administrator'. How would I go about doing that? I'm thinking something like a custom filter, or possibly making a scope variable where I put the matching objects in an array, and then repeat through them. What is the best practice for this case? Thanks. 回答1: The built in filter can handle this case...

ng-if causing $parent.$index to be set to $index

旧城冷巷雨未停 提交于 2019-12-22 11:18:25
问题 I have an ng-repeater with a nested ng-repeater contained within it. In the nested repeater I am trying to track the parents $index value, this works fine. However, when I introduce an ng-if in the same element that has a reference to $parent.$index, the parents index is set to the child's index. Any ideas on this? The code is running here. An example would be, I click on index 1 of parent 0 and get index 1 parent 1 as indexes. JavaScript var myApp = angular.module('myApp', []); myApp

ng-repeat inserting empty anchor tags

梦想的初衷 提交于 2019-12-22 10:15:10
问题 I'm trying to create a menu using angular. A menu item can have children requiring another ng-repeat to print the sub nav items. I'm noticing some strange behavior when attempting to insert an anchor tag within the 2nd ng-repeat. Link to fiddle: http://jsfiddle.net/npU7t/ <li ng-repeat="sub_menu_item in menu_item.sub_menu"> <a href=""> {{ sub_menu_item.title }} </a> </li> With { title: 'menu item with children', sub_menu: [ { title: '<-- empty anchor tag???' } ] } Results in <li ng-repeat=

Detect when a custom filter has completed in AngularJS [duplicate]

拟墨画扇 提交于 2019-12-22 09:40:23
问题 This question already has answers here : Calling a function when ng-repeat has finished (10 answers) trigger function after ng-repeat (1 answer) Closed 5 years ago . I have a custom filter function I'm calling for ng-repeat directive: <div ng-repeat="app in appVm.appList | filter:appVm.assetFilter">{{app.title}}</div> This obviously hits my assetFilter function for each app in the appList. When filtering is complete, I want to run another function. How can I detect when the filtering pass has