angularjs-ng-repeat

ng-repeat doesn't work when HTML is altered under $compile

感情迁移 提交于 2019-12-11 06:18:12
问题 Directive code: .directive('replace', function($compile) { return function (scope, element) { element.html(element.html().replace("Hej", "Hey!")); $compile(element.contents())(scope); } }); }) HTML <div ng-controller="GreeterController"> <div replace>Hej <div ng-repeat="e in arr">{{ e }}</div> </div> </div> Controller app.controller('GreeterController', ['$scope', function($scope) { $scope.arr = [1, 2, 3, 4]; }]); Live example As the title says, ng-repeat doesn't work when I'm using the

Angular 1: ng-repeat throws infdig error

痴心易碎 提交于 2019-12-11 05:39:14
问题 Controller: (function(angular) { var app = angular.module('t2w'); app.factory('httpq', function($http, $q) { return { get: function() { var deferred = $q.defer(); $http.get.apply(null, arguments).success(deferred.resolve).error(deferred.resolve); return deferred.promise; } } }); app.controller('JobsCtrl', ['$scope','httpq','baseUrl', function($scope, httpq, baseUrl) { httpq.get(baseUrl + '/jobs/json').then(function(data) { $scope.jobs = data; }).catch(function(data, status) { console.error(

while Exporting to PDF, column content is exceeding the column border in uigrid angularjs

隐身守侯 提交于 2019-12-11 04:43:17
问题 if i get the column data like this with no space in between $scope.gridOptions.data = [{"name":"rasheedsyedabdulhameed"}]; and this is my gridoptions $scope.gridOptions = { columnDefs: [ { field: 'name' }, { field: 'name' }, { field: 'name' } ], enableGridMenu: true, enableSelectAll: true, exporterCsvFilename: 'myFile.csv', exporterPdfDefaultStyle: {fontSize: 9}, exporterPdfTableStyle: {margin: [30, 30, 30, 30]}, exporterPdfTableHeaderStyle: {fontSize: 10, bold: true, italics: true, color:

Deleting firebase data that is displayed as a Table using AngularJS

﹥>﹥吖頭↗ 提交于 2019-12-11 04:34:35
问题 I have an HTML file which displays a data set in firebase as a table. As the data is in firebase I am using (key,client) in clientInfo to get the key as well. This key is used for the purpose of deleting a row. <table class="meeting"> <tr ng-repeat="(key, client) in clientInfo"> <td>{{ client.name }}</td> <td>{{ client.discount }}</td> <td>{{ client.vms }}</td> <td><button class="btn btn-delete tooltip" ng-click="deleteClient(key)"> <span>Delete this client</span></button> </td> </tr> </table

Dynamically loading CSS in angularjs (loading delay)

旧城冷巷雨未停 提交于 2019-12-11 04:28:31
问题 I am using two visual templates for a particular site, whose css conflicts quite a bit, so rather than doing a painful edit, I figured dynamic loading would do the trick. So I use this in my <head> <!-- css is loaded dynamically through angular --> <link ng-repeat="item in css.files" ng-href="{{item}}" rel="stylesheet"> And set $rootScope.css.files inside my .config() of my module. The CSS loads fine, however there is a noticeable delay between loading the page content, and loading the CSS.

AngularJS ng-file-upload not working inside ng-repeat

僤鯓⒐⒋嵵緔 提交于 2019-12-11 04:24:20
问题 I have directive "notes" which is basically a notes widget that I can add on any page and just add a name and id to it to allow people adding notes to that item. The users should be able to upload files to their notes using ng-file-upload as well now but I struggle to get the $scope.files populated by the ng-file-upload directive. I'm pretty sure it is as usual something stupid with the scope but I can't figure it out. So any idea why $scope.files gets not populated when I select a file?

How to remove default order of ng-repeat

我是研究僧i 提交于 2019-12-11 04:16:49
问题 How do I stop default sorting inside the ng-repeat for dynamic table data ? Currently I am getting below order: Addr | CustomerId | Name but what I want is below ordering: CustomerId | Name | Addr Any Help would me much appreciated. JS: app.controller('MyController', function ($scope) { $scope.Customers = [ { CustomerId: 1, Name: "John Hammond", Addr:'India' }, { CustomerId: 2, Name: "Mudassar Khan", Addr:'India' }, { CustomerId: 3, Name: "Suzanne Mathews", Addr:'India' }, { CustomerId: 4,

AngularJS filter returns empty result on page load

为君一笑 提交于 2019-12-11 04:15:02
问题 I have an input of which the value should be used as a filter query: <input type="text" ng-model="query" placeholder="Movie title"> and a repeat directive with a filter on a property of the repeated elements: <tr ng-repeat="movie in movies | filter:{title: query}"> When I enter a value into the text box the results are filtered. When I delete the input value all movies are shown. So far so good. But when the page (or view) is loaded the first time the filter returns no elements and the table

Dynamic addition of div using ng-repeat in angularjs

拜拜、爱过 提交于 2019-12-11 04:13:57
问题 I am a beginner in angularjs. I want to dynamically add a div while clicking on add icon.I have done some script on this . HTML part: <div ng-show="child" class="childDiv" data-ng-repeat="choice in choices track by $index"> <label for="childname" class="childname" >ServerName </label> <input ng-model="serverinfo.childname" type="text" required="required" placeholder="name"/> <label for="childname" class="childname" >Fullname</label> <input ng-model="serverinfo.childfullname" type="text"

AngularJS : isolated scope + two-way binding + ng-repeat not working

大憨熊 提交于 2019-12-11 03:55:53
问题 the ng-repeat outputs nothing. in the link function, i can see $scope.clients is an array. if i remove the isolate scope, and use the parent scope, the ng-repeat works. html with directive "clients". <div container ng-cloak ng-app="summaryReportApp" ng-controller="summaryReportController as summaryReport"> <fieldset clients="summaryReport.clients"> <legend>Clients</legend> <div align="left"> <div ng-repeat="client in clients track by $index"> {{client}} </div> </div> </fieldset> </div>