angularjs-ng-repeat

filter in ng-repeat by values?

时间秒杀一切 提交于 2019-12-25 07:59:53
问题 I would like to filter an ng-repeat by a key that has 4 values(1-4) using uib-tabs. Is there a way to do this inline with ng-model on the tab elements? If so, what is the format? For instance, I have an ng-repeat like this: <div ng-repeat="item in reportsData">{{item.name}} - {{item.packageID}}</div> and in my reportsData array I have ..."packageID": 1,... Where packageID can be of a value between 1 and 4. The trick is that I want to setup something along the lines of item.packageID >=1 How

Animation delay ng-repeat

吃可爱长大的小学妹 提交于 2019-12-25 07:14:00
问题 I have this code with ng-repeat and delay in css: <div class="card moveUp" ng-repeat="x in optionsCards" style="animation: moveUp 0.50s ease forwards;"> <span class="fec">Updated Aug 29, 2016</span> <span class="title">Internet Banner Advertising…</span> </div> I need that the delay value in every item of ng-repeat , increase. For example: First item: animation: moveUp 0.50s ease forwards Second item: animation: moveUp 0.60s ease forwards Third item: animation: moveUp 0.70s ease forwards How

ng-repeat: One-item-only source

一曲冷凌霜 提交于 2019-12-25 06:50:24
问题 This is my code: app.js $http.get("http://angularjs.uum.my/tt.json") .success(function(response) {$scope.scrollItems = response;}); $http.get("http://angularjs.uum.my/tt2.json") .success(function(response) {$scope.scrollItems2 = response;}); tt.json - have only 1 element http://angularjs.uum.my/app/#/timetable tt2.json - have two 2 elements http://angularjs.uum.my/app/#/timetable2 The problem is with page no. 1, where only one element exist, the page rendered empty list repeating x number of

Display details of selected options in Angularjs

怎甘沉沦 提交于 2019-12-25 06:44:34
问题 I am new to learn AngularJs. How to display adSet details of selected options? Here is my app.js file : app.controller("AddCompaignCtrl", function($scope){ $scope.status = ['active', 'inactive', 'closed']; $scope.objectives = ['obj1', 'obj2', 'obj3', 'obj4']; $scope.selectedCompaign = "Default-Campaign name"; $scope.selectedCompaign_id =0 $scope.compaigns = [ { id: 0, name: 'testCompaign 0', detail: { status : 'active', objective: 'obj1' }, adsets:[{ name :"adset 01", status:"active", budget:

angularjs passing parameters through directive and ng-repeat

纵饮孤独 提交于 2019-12-25 06:15:14
问题 Let's try again: here's a working plunker: http://plnkr.co/edit/RTrdsLY8ONoeDLPYSFJi?p=preview But the fields are connected each other. when you look at DOM: <input class="form-control ng-pristine ng-valid-maxlength ng-valid-minlength ng-valid ng-valid-required" type="text" name="fieldName" ng-model="fieldName" ng-minlength="3" ng-maxlength="20" required=""> ^^^^^^^^^^ of course! All have name="fieldName"! But why!? it should be first_name, last_name and age! Yes, there's a mistake in

Filter not working ng-repeat

ぃ、小莉子 提交于 2019-12-25 05:48:09
问题 I'm using Salvattore (masonry like grid) in my angular app but the filter option in ng-repeat does not work. I think it's because Salvattore wraps each repeated item in a separate div to make a grid (in my example it's div.col-4 ) <input type="text" ng-model="search"> <div class="row grid" salvattore> <div class="entry" ng-repeat="e in data | filter:search"> {{e}} </div> </div> The output of the above is similar to the following: <div class="row grid" salvattore="" data-columns="3"> <div

Having trouble repeating correct items with nested ng-repeat and ng-if

狂风中的少年 提交于 2019-12-25 04:43:20
问题 I have the following html: <div ng-repeat="tab in tabs" ng-if="tabIsActive(tab, $index)"> <ul ng-repeat="section in tab.sections"> <h2 ng-class="productTitle" ng-repeat="child in section.children" ng-if="sideTabIsActive(section, $index)"> <img ng-src="{{ child.productImageURL }}"/> <li>{{ child.title }}</li> </ul> </div> This is what the "tabs" javascript object looks like: My desired output is the subcategory titles(e.g. children0.title) and image(e.g. children0.productImageURL) listed for

Having trouble repeating correct items with nested ng-repeat and ng-if

我只是一个虾纸丫 提交于 2019-12-25 04:43:06
问题 I have the following html: <div ng-repeat="tab in tabs" ng-if="tabIsActive(tab, $index)"> <ul ng-repeat="section in tab.sections"> <h2 ng-class="productTitle" ng-repeat="child in section.children" ng-if="sideTabIsActive(section, $index)"> <img ng-src="{{ child.productImageURL }}"/> <li>{{ child.title }}</li> </ul> </div> This is what the "tabs" javascript object looks like: My desired output is the subcategory titles(e.g. children0.title) and image(e.g. children0.productImageURL) listed for

view pending status data in table by default

北城以北 提交于 2019-12-25 04:15:12
问题 <select class="form-control" id="selectrequest" ng-model="selectedrequest"> <option value="pending" > Pending </option> <option value="approved"> Approved </option> <option value="rejected"> Rejected </option> </select> <tr ng-repeat="mymodel in vm.modelname | filter:selectedrequest"> <td>{{mymodel.name}}</td> <td>{{mymodel.triggername}}</td> <td>{{mymodel.status}}<td> </tr> vm.modelname=[{ name:'Peter', triggername:'Peter1', status:pending },{ name:'Jack', trigger name:'Jack Hein', status

How to set a boolean flag to collapse/expand a row with ng-repeat

不想你离开。 提交于 2019-12-25 03:38:24
问题 I have this plunker code. What I'm trying to do, is to display the gray box one time per row. To achieve this, I thought to modify the partition filter in order to return a JSON to add it a new property by row to know if the gray box is expanded or not. But, I could Not successfully return a JSON. Do you know how to modify the filter to return a JSON or a better way to show the gray box by row? Related questions: Push down a series of divs when another div is shown Update 1 The issue could be