angularjs-ng-repeat

Angularjs disabling drop down

我与影子孤独终老i 提交于 2019-12-08 21:49:28
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.roleDetails" data-ng-selected="{{abc.adRole == abc.selectedAdRole}}" value="{{abc.adRole}}"> {{abc

Long array list rendering makes page scrolling slow in Angular.js

邮差的信 提交于 2019-12-08 15:01:18
问题 When trying to render more than 120 items from an array (with images) the scrolling of the list becomes slower. Basically, when I am loading new data in infinite scroll, I am concatenating old array data with new array data. On the other hand, popular websites like dribbble, behance dont seem to have this issue. Maybe this issue is specific to Angular.js? Has anyone faced this problem in their projects? 回答1: INFINITE SCROLLING IN ANGULARJS No need of any additional plugins. app = angular

Showing unique dropdown options in Angularjs

混江龙づ霸主 提交于 2019-12-08 13:50:35
问题 I have a following drop down which is working fine <select class="form-control" ng-model="cc.id"> <option value="">Chose Id</option> <option ng-repeat="account in accounts |unique:'id'" value="{{account.id}}">{{name.id}}</option> </select> It gives me following options in the dropdown 101 101 119 120 121 121 While it should be only showing the unique id in options as... 101 119 120 121 Accounts consists of jason array of Account which has act_id (primary key) id fname lname location Can you

Binding ajax data to ng-include with recursive call to load template

五迷三道 提交于 2019-12-08 13:50:26
问题 Sorry if the title is quite cryptic, I'm trying to replicate this example: http://plnkr.co/edit/NBDgqKOy2qVMQeykQqTY?p=preview and it works fine, but if I load data via ajax it doesn't work. The original controller is: app.controller('MainCtrl', function($scope) { $scope.links = [ { text: 'Menu Item 1', url: '#', },{ text: 'Menu Item 2', url: '#', submenu: [ { text: 'Sub-menu Item 3', url: '#', },{ text: 'Sub-menu Item 4', url: '#', submenu: [ { text: 'Sub-sub-menu Item 5', url: '#', },{ text

how to auto check in ng-repeat check box when i change dropdown values

独自空忆成欢 提交于 2019-12-08 11:12:37
问题 hi all i am using angularjs ng-repeat i have checkbox and dropdown bind it now my need is when i change the dropdown values means automatically checkbox will check based on dropdown slection <div ng-repeat="BFMaterialStream in BFMaterialStreams"> <input type="checkbox" ng-change="checkchange(BFMaterialStream.MaterialStream,$index)" ng-model="selection.ids[BFMaterialStream.MaterialStream]" name="group" id="BFMaterialStream.MaterialStream" /> {{BFMaterialStream.MaterialStream}} <select id=

Create a list without ngRepeat

有些话、适合烂在心里 提交于 2019-12-08 10:28:27
问题 I would like to create a directive, that does not need ngRepeat, because there is some additional functionality on the directive, that doesn't play good with ngRrepeat. This is my directive with ng-repeat: <div> <ul> <li ng-repeat="item in items track by $index" ng-class="attrs.itemTheme" data-item="{{ item[attrs.itemId]}}"> <div ng-include="attrs.tpl"></div> </li> </ul> </div> attrs.tpl, nt-dimension is another directive, that uses the items values from ngRepeat: <script type="text/ng

Recursive AngularJS Ng-Repeat without parent/child comparators

你离开我真会死。 提交于 2019-12-08 09:35:37
问题 I am needing to create a recursive ng-repeat for my file structure. Everything I am finding on the interwebs is using parent/children comparators. Like so: $scope.categories = [ { title: 'Computers', categories: [ { title: 'Laptops', categories: [ { title: 'Ultrabooks' }, { title: 'Macbooks' } ]}, // ......continued..... However, my data is stored in firebase like what is displayed in this JSFIDDLE, https://jsfiddle.net/mdp4dfro/6/. (I'm not going to take the time to format all that so

AngularJs radio buttons are connected when using ng-form with ng-repeat

三世轮回 提交于 2019-12-08 07:36:59
问题 See this plnkr http://plnkr.co/edit/WZHMuYY3y2wbI6UysvY6?p=preview When using a ng-form tag on an ng-repeat which contains a radio button group, the radio buttons are linked so if you check a radio button in one ng-repeat it will deselect in all the other ng-repeats. This puzzles me as the model of the ng-repeat is otherwise isolated from the other items. This is not only an issue when using ng-repeat. It also occurs when having multiple instances of a custom directive with isolated scope

Undefined $http data when resolved with `.then` method

隐身守侯 提交于 2019-12-08 07:31:29
问题 I used the console log which returned the array of data fetched from the server, but when I call the scope on the html I get an undefined error on the console. app.service('blogpostservice', ['$http', function ($http) { this.getMoreData = function (pagecount) { return $http.get('/api/posts/' + pagecount); } }]); app.controller('MainController', ['$scope', 'blogpostservice', function ($scope, blogpostservice) { $scope.pagec = 1; this.getMoreData = function () { blogpostservice.getMoreData(

Connect to API endpoint with Angular factory

时光毁灭记忆、已成空白 提交于 2019-12-08 06:44:46
问题 I am trying to connect with API endpoint via the simplest AngularJS snippet but have some problems which are stopping me. Here is my controller: app.controller('appController', ['$scope', 'skills', function($scope, skills) { skills.success(function(data) { $scope.skillsList = data; }); } ]); And my factory: app.factory('skills', ['$http', function($http) { return $http.get('https://www.persevy.com/skills') .success(function(data) { return data; }) .error(function(err) { return err; }); }]); I