angularjs-ng-repeat

AngularJS filter search not working at all

隐身守侯 提交于 2019-12-25 03:00:31
问题 I am writing an app using AngularJS on the front end. I want to search through a table by any word/field; one search box for everything. I tried to follow this plunker's working example: http://plnkr.co/edit/aIuSDYlFbC4doW6pfsC9?p=preview This is my code on the front end: <div class = "row"> <label>Search: <input ng-model="query"></label> </div> <div class = "row"> <table ng-repeat="post in posts | orderBy: sort | filter: search"> <tr> <td> {{index(post)}} </td> <td> {{post.title}} </td> <td>

How to select Parent Checkbox when a Child is selected inside ng-repeat

一世执手 提交于 2019-12-25 02:57:50
问题 I am having a very hard time trying to figure out a solution for this. I have a checkbox group where the first checkbox is the parent and the following in that set will be child. I want the parent checkbox to be selected automatically if one of the child's checkbox is selected. Similarly parent needs to be get unchecked if no child is selected. Here is my jsfiddle example: http://jsfiddle.net/Alien_time/PqTR7/3/ The main difficulty I am facing is because the checkboxes are created dynamically

Is it possible to limit the number of displayed items in a loop in AngularJs

爱⌒轻易说出口 提交于 2019-12-25 02:44:12
问题 I have a list of categories and many questions which belongs to different categories. { "id": 5, "description": "Does your site have Facebook?", "question_category_id": 3 } { "id": 1, "name": "Network", "description": "Network" } <table ng-repeat="c in categories"> <thead> <tr> <th>{{ c.id }}. {{ c.description }}</th> </tr> </thead> <tbody ng-repeat="q in questions | filter: { question_category_id: c.id } : true"> <tr> <td>{{q.description}}</td> </tr> </tbody> </table> This is the code which

Firebase loop look up data

筅森魡賤 提交于 2019-12-25 02:25:18
问题 $scope.authorizedUsers = []; fbRef.child('folders/').child($routeParams.folderID).once('value', function(ss) { ss.forEach(function(childSnapshot) { fbRef.child('users/').child(childSnapshot.name()).once('value', function(user) { $scope.authorizedUsers.push(user.val()); console.log($scope.authorizedUsers); }); }); }); I use above code to look up master data then loop them in view using ng-repeat <div ng-repeat="user in authorizedUsers">{{user}}</div> but the looped data display sometimes only.

checkbox options = select options - angularjs

假装没事ソ 提交于 2019-12-25 01:55:22
问题 I have successfully populated Designations to select option through Json and now i wanted to create multiple checkbox filter to my search results.. Here below is the working code for select option var app = angular.module('plunker', []); app.controller('MainCtrl', function($scope) { var json = { "modules": [{ "myid": "70", "realname": "Kishore", "full_name": "Kishore Chandra", "category": "professional", "firm_name": "Yes", "designation": "Design-Build Firm", "address": "Dwarakanagar 5th lane

$http.get doesn't load JSON

橙三吉。 提交于 2019-12-25 01:48:22
问题 I can't load my JSON file. There is no error. I'm stuck, any suggestions? app.js: app.controller('StoreController',['$http','$scope', function($http,$scope) { $http.get("data.json").success(function(response) { $scope.names = response; }); }]); index.html <html ng-app= "App"> <head> <link rel="stylesheet" type="text/css" href="bootstrap.min.css" /> <script type="text/javascript" src="angular.min.js"></script> <script type="text/javascript" src="app.js"></script> </head> <body ng-controller=

ng-repeat values with 3 columns in table? - AngularJS

耗尽温柔 提交于 2019-12-25 01:05:22
问题 I'm trying to display data in 3 column table format. With the below code am able to get data in 3 column format but I want it in proper table, with tr and td. <body ng:app="myApp" ng:controller="myCtrl"> <span ng:repeat="(index, value) in array"> {{value}}<br ng:show="(index+1)%3==0" /> </span> </body> and lvar app = angular.module('myApp', []); app.controller('myCtrl', function ($scope) { $scope.array = ["opt1","opt2","opt3","opt4","opt5","opt6","opt7"]; }); Fiddle: http://jsfiddle.net/JG3A5

AngularJS: nest directive in ng-repeat for using smart-table with dynamic table fields

百般思念 提交于 2019-12-24 18:35:02
问题 I'm trying to use angular-smart-table for grid in my new AngularJS app. According to the document, to sort a column, I should use the st-sort directive like bellow: <th st-sort="firstName">first name</th> <th st-sort="lastName">last name</th> However, I'm trying to re-use the piece of code for not only one table, so I don't know the table field names in advance until the run-time. I'm doing something like bellow: <script type="text/ng-template" id="content1"> <div ng-repeat="table in $ctrl

Going to the position of a filtered ng-repeat element

杀马特。学长 韩版系。学妹 提交于 2019-12-24 15:07:42
问题 I have a list of ng-repeat elements that are filtered based on boolean vars in scope. HTML: <button ng-click="toggleSection(1)">Section 1</button> <button ng-click="toggleSection(2)">Section 2</button> <button ng-click="toggleSection(3)">Section 3</button> <div id="$index" ng-repeat="section in sections track by $index | filterSections"> ... </div> the filter: myApp.filter('filterSections', function() { return function(input) { var returnArray = []; $.each(input, function(index, bool) { if

Access items from array within object property using ng-repeat

半腔热情 提交于 2019-12-24 15:05:15
问题 I'm trying to create a simple category with items kind of setup, where the categories will be all my albums with all the tracks. I've tried to set it up like this: enitoniApp.controller('musicItems', ['$scope', function ($scope) { $scope.albums = [ { name: 'Over The Mountains', tracks: [ { name: 'Over The Mountains', ref: 'otmt', released: 0, price: 0, }, { name: '!C3', ref: 'ice', released: 0, price: 0, } ] } ] }]); and in the view: <body> <div id="allMusic" ng-controller="musicItems"> <div