angularjs-ng-repeat

How to pass multiple parameter in angular filter function, not custom filter

青春壹個敷衍的年華 提交于 2019-12-12 08:28:35
问题 I tried hard and visit lot of similar question like this but still unable to solve this issue. I want to pass extra parameter in angular filter function. I found solution as below but it's not working. I am getting undefined for object which I have used in ng-repeat . <li ng-repeat="user in users | filter:isStatus(user,secondParam)">{{user.name}}</li> There are solution for angular custom filter as below but that also not working with angular filter function. <li ng-repeat="user in users |

Remove item from list after filtering

别等时光非礼了梦想. 提交于 2019-12-12 08:22:43
问题 I have the following issue: I've create a list that allow the user to delete an item from list, as following: When user click on trash icon, the item is removed normally. The problem is when the user uses the filter on top. In that case, if I delete the number 6565 (index 4 in original list, 1 on filtered list), the item deleted is on index 1 on original list, resulting on delete the register with number #564456 This is my delete call on click: $scope.deleteOwn = function (uuid) { console.log

Can I avoid the object variable name in ng-repeat loop?

早过忘川 提交于 2019-12-12 08:03:25
问题 When defining an ng-repeat directive to iterate over an array, the syntax specifies ng-repeat="friend in friends" , and then within the template you use the interoplation operator like so {{friend.name}} . Is it possible to have the properties assigned to the current item scope, rather than a variable in it? So I could call just {{name}} instead of {{friend.name}} ? The reason being is that my directive is being used in the scope of two different templates - for example I might have a

AngularJS : Decision tree implementation

纵饮孤独 提交于 2019-12-12 07:03:31
问题 I am trying to write a quiz app.Below is the source code.Currently it is working like as below : On Click start Quiz,first questions shows up. User selects correct option and it moves to say question number 3. if User selects wrong option,it moves to another question say question number 4. and so on... Please check link http://plnkr.co/edit/sYG9jjX0JATbQhJ1hNf6 What I want to achieve is as below : On Click start Quiz,first questions shows up. User selects correct option and it moves to say

TypeError: format.match is not a function in moment angularJS

点点圈 提交于 2019-12-12 05:38:27
问题 Hi I am trying to compare today's date with ng-repeat date field using momentJS here is my html code <span class="time-stamp float-right" ng-if="recent.createdAt | amDateFormat: 'DD/MM/YYYY' == todayDate">{{ recent.createdAt | amDateFormat: 'hh:mm A' }}</span> <span class="time-stamp float-right" ng-if="recent.createdAt | amDateFormat: 'DD/MM/YYYY' != todayDate">{{ recent.createdAt | amDateFormat: 'DD/MM/YYYY' }}</span> and here is today's variable I declared var currentTime = new Date() var

How to filter the data in angularjs?

依然范特西╮ 提交于 2019-12-12 05:25:27
问题 I am trying to filter the data according to firstname and title properties but it's not filtering. <label>by Name <input type="text" ng-model="searchText.data.firstname"></label> | <label>by Title <select name="title"> <option value="">All</option> <option value="">Zone Manager</option> <option value="">Logistic agent</option> </select></label> <hr/> <div ng-repeat="accDetails in acct_list | filter:searchText"> {{accDetails.data.firstname}} | {{accDetails.data.lastname}} | {{accDetails.title}

Angularjs Table using JSON data

送分小仙女□ 提交于 2019-12-12 05:09:29
问题 My two JSON arrays are, $scope.myHospital = [ {"id":"1","name":"hos1"}, {"id":"2","name":"hos2"}, {"id":"3","name":"hos3"}, {"id":"4","name":"hos4"}, {"id":"5","name":"hos5"} ]; another one is $scope.data = [ { "category":"first category", "procedure":[{ "name":"pro1", "hospital": [ {"id":"1","price":"1101"}, {"id":"2","price":"1102"}, {"id":"3","price":"1103"}, {"id":"4","price":"1104"}, {"id":"5","price":"1105"} ] }, { "name":"pro2", "hospital": [ {"id":"1","price":"1201"}, {"id":"2","price

AngularJS ng-repeat 2D array and display only certain values based on index

﹥>﹥吖頭↗ 提交于 2019-12-12 05:09:27
问题 I have the the following two dimensional array: SideNavItems= [["Parent Section 1", "Parent Section 2"],["Parent Section 3", "Parent Section 4"]] I want to use ng-repeat to display them the following way on a page that has tabbed navigation: Desired output: When first tab is selected: Parent Section 1 Parent Section 2 When second tab is selected: Parent Section 3 Parent Section 4 Current output: When first tab is selected: Parent Section 1 Parent Section 2 Parent Section 3 Parent Section 4 I

Angular - Dynamic ng-model inside ng-repeater

旧街凉风 提交于 2019-12-12 04:57:23
问题 I have a form for search data, some fields are generated dinamically inside a ng-repeat. The problem is to assign ng-model to all fields that i must get to do the search. I need to use the {{masterAttribute.Name}} as ng-model, or whatever that i can read to do in my search. HTML is <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <body ng-app="MyApp" ng-controller="ricercaAttivita"> <div class="accordion-group" ng-repeat="masterAttribute in

ng-repeat: One-item-only source (XML)

谁说胖子不能爱 提交于 2019-12-12 04:50:54
问题 To simplified things, I've made a mistake in my question here: ng-repeat: One-item-only source So I ask here the same question but with the real problem : This is my code: app.js $http.get("http://angularjs.uum.my/tt.xml", {transformResponse:function(data) { // convert the data to JSON and provide // it to the success function below var x2js = new X2JS(); var json = x2js.xml_str2json( data ); return json; } }) .success(function(response) {$scope.scrollItems3 = response.NewDataSet.Table;});