Search Posts

Category: angularjs-filter

Custom filter ‘filter’ in Angularjs

I have a json array which contains months number and years. I am iterating that array in template and displaying month and year. I am using custom filter ‘monthName’ to convert month number to month names. Now I want to filter out the displayed list of month names and year based on user input. Cannot use angular js inbuilt filter on array as it contains month number and not names. Here are the code snippets […]

Date filter causes ng-repeat+other filters to be extremely slow in IE11

I have an ng-repeat plus some custom filters, and a date range filter, all works wonderful in Chrome, Mozilla, android. But in IE with the Date Range filter everything grinds to a halt. The filters take 10 seconds to register (I have filters tied to checkboxes and free text), with the checkbox animations also lagging until the data loads. If I remove the date range filter then everything is fine in IE. The list is […]

How to filter multiple ng-repeat with different ng-show

I’m using Angularjs. I’d like to filter some data, which is inside a vertical tabs or menu. In the code below you can see the way I’m doing it rigth now. Firstly, I show a list of car types. If you select one of them, the models related with that type of car are loaded from database and added to the listCarTypes as listCarTypes.models. The second step is showing the list for car models. Again, […]

Angularjs don’t apply filters when I call $scope.digest [duplicate]

This question already has an answer here: Filter do not refresh 1 answer I have an angularjs filter, for localisation. In html: <span>{{ ‘Delete’ | i18n}}</span> js .filter(‘i18n’, [‘localize’, function (localize) { return function (input) { return localize.getLocalizedString(input); }; }]) After I change language, I call $scope.digest(), but none of these {” | i18n} filters are in the watch list of angularjs so.. the new localization is not applied. How can I make angularjs to […]

I want to add line number before each line, I’m using angularJs json filter

I have code preview that displays json object. I want to add line number before each line. The code is working great, but I’m unable to add the line number before each line. I’m using angularJS 1.5.8. In order to display the json i’m using the angularJS json filter. I want it to look something like that: 1 | { 2 | “a”: 1, 3 | “b”: 2 4 | } now it looks like […]

ui-grid id showing in cell from dropdown not value name

I have been trying to use the following ideas from other stack questions but I am still not getting the result What I actually Want. ui-grid dynamic cellFilter ui-grid display cell as select tag I have a ui-grid with a dropdown menu. The user can pick which connection string they want to use and the id of that string is set to the field and then through the gridApi.edit.on.afterCellEditthe id is sent to be processed. […]

AngularJS Filter to sum collection by property returning NaN [on hold]

I have a filter that sums items in a collection by a specified property, but it is calculated to be NaN. What am I doing wrong? Here is my code: (function() { ‘use strict’; angular .module(‘Test’, []) .filter(‘sumByColumn’, function () { return function (collection, column) { var total = 0; collection.forEach(function (item) { total += parseInt(item[column]); }); return total; }; }) .controller(‘TestController’, function() { var vm = this; vm.approve = [{ name: ‘test1′, quantity: ’30’, […]

angularJS filter using array type(?) ng-model

I wanna make filter working at only one element. To make filter, I searched SO, and find way to make it I want. But I used ‘select’ tag to choose element applies to filter, I got problem when selected value is NULL. <div class=”input-group”> <select class=”form-control” ng-model=”setParam”> <option value=””>All</option> <option value=”atName”>Name</option> <option value=”atComp”>Company</option> <option value=”atDep”>Department</option> <option value=”atPos”>Position</option> <option value=”atTel”>Tel</option> <option value=”atEmail”>Email</option> </select> </div> <div class=”input-group”> <span> <input type=”text” class=”form-control” ng-model=”atParam[setParam]”> </span> <tr data-ng-repeat=”row in attendees […]

For loop through custom filter results

I have a list of applications, I have a custom filter for getting the unique values of a specified field. I ng-repeat out checkboxes for each of these unique values to filter a table. I need to for loop using the values returned by the unique filter. This is so I can have a button which unchecks all of the checkboxes returned in the ng-repeat. I have it working but it loops through ALL of […]

Next Page »