angularjs-ng-repeat

All checkboxes get checked when one is checked (should be just the one checked) - inputs generated with angular js

我怕爱的太早我们不能终老 提交于 2019-12-20 02:00:34
问题 I am making app with angular js. It goes like this. User creates groups and adds group names User creates 'websites' and for each website he can check groups that are created in previous step Problem is that all groups checkboxes get checked when he checks just one. Here is the code that generates the checkboxes: <p>Groups: <label ng-repeat='group in groups'> <input type="checkbox" ng-model="newSite.groups" name="group-check" value="{{group.id}}"/> {{group.name}}</label></p> Here is the code

checkbox unchecking itself after angularjs filter applied

亡梦爱人 提交于 2019-12-20 01:42:08
问题 This causes the same item to be added to the array - which is used for querying - potentially twice. When the modal is closed and opened again and filtering is not used, everything is fine (this is because my modals are simply within the HTML, I just ng-hide them on click). When an item which has already been added, but its checkmark has been lost due to filtering, is checked again two of the same items are added. When it is unchecked both are removed, unless it is the last item in the array,

Trouble in filter table data between two selected dates using angularjs

烈酒焚心 提交于 2019-12-19 10:15:46
问题 I am working on filtering table content based on two selected dates. It do filter the date but result is not correct. dateRange Filter is written in controller. ProductionController angular.module('app').controller('ProductionController', ['$scope','$state','ProductionService','FarmerRepository', function(scope,state,ProductionService,FarmerRepository) { fetchAllUsers(); function fetchAllUsers() { ProductionService.fetchAllUsers().then(function(d) { produceList = d; scope.produceList =

angularjs how to increment init variable value in ng-repeat without onclick?

我与影子孤独终老i 提交于 2019-12-19 06:28:25
问题 How to increment init variable value in ng-repeat <div ng-if="feedData.carouselMode == true" ng-init='start=0' ng-repeat="a in carousel_data"> <div class="owl-demo" class="owl-carousel" owl-carousel > <div class="item" ng-repeat="(key, item) in a.carouselFeeds" ng-init="start=start+1"> {{start}} <div ng-click="go('{{key}}', item.feedUrls.length, 'rtl')" ng-swipe-left="go('{{key}}', item.feedUrls.length, 'rtl')"> <img class="lazyOwl" ng-src="{{item.img}}" /> <span class="innersquare" image-ja=

How to get selected value from ng-repeat

房东的猫 提交于 2019-12-19 05:08:11
问题 This is my code. I m getting data through ng-repeat and showing it as shown in below code. What I want is if I click on either of the name then it should alert me with that name. How can I achieve this?? var myfriend = angular.module('myfriend',[]); myfriend.controller('myfriendController', function($scope) { $scope.record = [ { "id" : "01", "firstname" : "Mohan ", "middlename" : "K", "lastname" : "Futterkiste1" },{ "id" : "04", "firstname" : "Rohan ", "middlename" : "A", "lastname" :

How to get selected value from ng-repeat

梦想与她 提交于 2019-12-19 05:08:10
问题 This is my code. I m getting data through ng-repeat and showing it as shown in below code. What I want is if I click on either of the name then it should alert me with that name. How can I achieve this?? var myfriend = angular.module('myfriend',[]); myfriend.controller('myfriendController', function($scope) { $scope.record = [ { "id" : "01", "firstname" : "Mohan ", "middlename" : "K", "lastname" : "Futterkiste1" },{ "id" : "04", "firstname" : "Rohan ", "middlename" : "A", "lastname" :

AngularJS Table creation with ng-repeat

99封情书 提交于 2019-12-19 03:14:25
问题 I get following response from database. about array of classes where classes are nested in groups and finally students. "Response":[ { "Id":1,"Name":"Class 1","Location":"Building 1","Groups":[ { "Id":1,"Name":"GB1","Students":[ { "Id":1,"Name":"Mike","RollNo":"1","Performance":{ "Id":1,"Math":"90","Physics":"70","English":"60" } },{ "Id":2,"Name":"John","RollNo":"2","Performance":{ "Id":2,"Math":"90","Physics":"70","English":"60" } },{ "Id":3,"Name":"Muffin","RollNo":"3","Performance":{ "Id"

AngularJS - Can I use data binding value depending on ternary operator

我们两清 提交于 2019-12-18 19:49:13
问题 I have an ng-repeat li elements and I want to set a specific value for that li depending on whether a function returns true or false and I don't want to do it in the controller because I have dependency issues where it makes it Minimize or Maximize for ALL li elements but I want it to be for each individual li element. I tried using several things including the following without any luck. I am not sure what I am doing wrong but I would appreciate any input or any other way of doing this.

Custom filter giving “Cannot read property 'slice' of undefined” in AngularJS

冷暖自知 提交于 2019-12-18 19:07:40
问题 My custom startFrom filter is giving me an error. app.filter('startFrom', function() { return function(input, start) { start = +start; //parse to int return input.slice(start); } }); app.controller("PostCtrl", function($scope, $http) { $scope.currentPage = 0; $scope.pageSize = 10; $scope.hidePagination = true; $scope.search = function() { $http.get('someurl').then(sucesscalback,errorcalback); function sucesscalback(response) { $scope.hidePagination = false; console.log("Success:"); console

Error: [ngRepeat:dupes] what does this mean?

一世执手 提交于 2019-12-18 18:53:44
问题 repeat directive outputing wine records from an api. I have a factory function to serve up the wine API which is then accessed in my controller app.factory("Wine", function ($http){ var factory = {}; //getWines factory.getWines = function(){ return $http.get("http://www.greatwines.9000.com") } } Controller: app.controller("winesCtrl", function($scope, $http, Wine){ Wine.getWines() .success(function(wines){ $scope.wines = wines; }) .error(function(){ alert("Error!"); }); }); VIEW: <h2>Wine