Search Posts

Category: filter

I’d like to filter a list according to whatever the user enters in the textbox. I’m using angularJS. Why isn’t the code working?

I try to make my own filter called myFilter and try to pipe the person array through myFilter. All I get as the output is “Enter name: ” followed by a textbox. Even if I try to write letters like A or B or C, nothing gets displayed. <!DOCTYPE html> <html> <head> <script src =”https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js”> </script> </head> <body> <div ng-app=”myApp” ng-controller=”myCtrl”> <p>Enter name: <input type=”text” ng-model=”test” /></p> <ul> <li ng-repeat=”x in person | myFilter”> {{x}} […]

$sce.trustAsHtml filter is not getting applied with ng-bind-html

I’m trying to display the html content which I receive in my div.testData by using ng-bind-html together with filter. I’ve already included ‘ngSanitize’ in my app. But somehow, it works only partially. Seem like, filter is not getting applied. It works fine when I create a local file and check, but doesn’t work when I use the same code in my project environment. Sample data: $scope.userProfile.Information = ‘&lt;p&gt;Hello, this is sample data to test html.&lt;/p&gt;’; […]

Filter results in table using select created through object property in angularJS

I’m trying to create a filter which will filter out the results in the table based on the value selected in the dropdown. Currently, it works for all the dropdowns except the ‘type’. The ‘type’ dropdown has been created using the unique properties from an array of objects. So, now, it contains two values ‘Internal’ and ‘External’. Based on the value I select, it should show me only the filtered results in the table. But […]

Angularjs: Search filter now working when name starting with ! (exclamation mark)

I have list of states and I have added search filter on name of states. I have array like this: stateList : [{name: ‘abc’, area:500},{name: ‘!def’, area:500}] I have <li> with ng-repeat=”state in stateList | filter:{name:searchText}” Search text box with ng-model=”searchText” Search is working in normal scenario but when I search !(exclamation mark). It is not giving any result. It should give state with name ‘!def’ Source: AngularJS

How to filter Date format "2016-09-12 11:21:50 BRT" to format dd/MM/yyyy on Datatable or Angular Controller?

I need convert a date from back-end (JAVA) to front-end (Angular), the format date is “2016-09-12 11:21:50 BRT” or “2016-09-12 11:21:50 BRST”. I using a datatable javascript to populate a table on front-end. I need a filter for datatable or angular controller, I try used $filter of Angular, but did not work. Source: AngularJS

How to filter the list of countries by its first letter while search in ui-select using angular js?

How can i search the word by filtering the list by its first letter? <td class=”country-selection-cell”> <ui-select multiple ng-disabled=”service.serviceName === null” ng-model=”service.countries” close-on-select=”false” ng-change=”vm.checkIfDuplicatesExist(newServiceWithCountriesForm)” ng-attr-title=”{{service.serviceName === null?’Please select a service first’:’Choose countries’}}” ng-required=”true”> <ui-select-match placeholder=”Select countries…”> {{$item}} </ui-select-match> <ui-select-choices repeat=”country in vm.countries | filter:$select.search track by $index” position=’down’> {{country}} </ui-select-choices> </ui-select> </td> Source: AngularJS

GroupBy and limitTo does not work together ? AngularJS

I googled very hard but can’t find solution for this. I want to use groupBy and limitTo together but its does not work. My code: <ul ng-repeat=”(key, value) in items | groupBy: ‘group’ | limitTo: limit”> … </ul> JS: $scope.limit = 2; // its dinamic value $scope.items = [ {name: “Audi”, group:1}, {name: “BMW”, group:1}, {name: “Dodge”, group:2}, {name: “Fiat”, group:2}, {name: “Ford”, group:3} ]; If they are seperate, then its work, but when they […]

Search filter with regex stuck my search filter and It does work without refresh?

I am searching for patient through my search filter.It worked in simple case but when I search with sabir it stuck and after removing the searchText sabir It does not work.It doesn’t generate the request next time.How do I handle sabir in angular2. Thanks in advance Here is code snippet Url which does work and does not work? work “http://172.16.1.101:8080/openmrs/ws/rest/v1/patient?q=sabir&v=full” Does not work “http://172.16.1.101:8080/openmrs/ws/rest/v1/patient?q=&v=full” I am using this function for handling the Url. ValidURL(str):boolean { […]

Filtering list items with ng-repeat from a selection/de-selection of a combination of checkboxes

I have a list of items which are frequently updated, based on changes to a price property. If the price of an item falls below a certain value (below 5) that item has a ‘selected’ property set to true and displayed in the results table (filtered on the selected property). ng-repeat=”item in dataPrices | filter: {selected:true}” I want to add a series of checkboxes which, based on the selection/de-selection of a combination of checkboxes used […]

Filter table after click data AngularJS

I need to filter table – after click name in the list: <ul ng-repeat=”f in filter”> <li ng-model=”search.name”> <a class=”left-menu-link”> {{f}} </a> </li> </ul> The table should list only that name which I chose. My plunker: http://plnkr.co/edit/g1t4pludTTIAJYKTToCK?p=preview // Code goes here var app = angular.module(‘app’, []); app.controller(‘FirstCtrl’, function($scope) { $scope.data = [{ “name”: “afdfg Nixon”, “system”: “System Architect” }, { “name”: “sdfasdfas”, “system”: “System Architect” }, { “name”: “ggg Nigadfgxon”, “system”: “System Architect” }, { […]

Next Page »