Search Posts

Category: angular-filters

How to Use Highlighting Filter Through Angular Controller

I’m trying to highlight my search results based on the filter defined by this answer: https://stackoverflow.com/a/40719955/6521206 Based on this post (https://www.infragistics.com/community/blogs/b/dhananjay_kumar/posts/how-to-create-custom-filters-in-angularjs) it would seem that all I have to do is create a separate filter before the controller, but no search results seem to be highlighted. I’m relatively new to Angular so if this is just a simple syntax issue regarding declaring filters in controller, apologies in advance. Here is my code: https://next.plnkr.co/edit/qpyvZuvI8vw8q6on?open=lib%2Fscript.js&preview Thank you […]

AngularJS – Array as filter

How can I setup a filter in an ng-repeat that use strings and an array of strings? HTML <div ng-repeat=”type in types| orderBy : ‘name’ | filter:{typology:currTipology}” JavaScript var myData = [‘string_1’, ‘string_2’, [‘string_3’, ‘string_4′]]; I’ll use a button for every myData entry to assign the string value to ┬┤currTipology`. Source: AngularJS

Dynamic multiple object filter AngularJS

I want to filter the names from my data, tags of filter are basically check boxes and are list of filters like: list = [ant, bak, cat, drake] etc. This list is populated from the server, and the user can check any of them If the user selects [ant, drake] then data should be filtered and displayed as ant and drake Code: <ul class=”jurisd-check”> <li ng-click=applyFilter(data) class=”clearfix” ng-repeat=”data in jurisdictions”> <label>{{data.name}} <input type=”checkbox”></label> </li> </ul> […]

Filter Search AngularJS

I want to filter in search my catalogs json, but my code doesn’t work, here is code : <input type=”text” style=”width:275px;margin-top:5px;” class=”form-control form-control-sm form-control-rounded” placeholder=”Search…” ng-model=”search”> <br /> <br /> <div class=”panel-body”> <div class=”cui-ecommerce–catalog”> <div class=”row”> <div ng-repeat=”(name, text) in textures | filter:search”> <div ng-repeat=”url in text”> <div> {{url.url}} <a href=”javascript: void(0);” style=”cursor:default;”> <img ng-src=”{{url.url }}” /> </a> </div> </div> </div> </div> </div> </div> And my plunker : https://plnkr.co/edit/30nyExfhnLWy35p906CJ?p=preview Thanks for answers in advance!!! Source: […]

Filter search in image json AngularJS

Here is my code : <div class=”container” ng-controller=”miControlador”> <ul class=”left-menu-list list-unstyled” ng-repeat=”(name, text) in textures”> <li style=”margin-left:20px;”> <a style=”cursor:pointer;”>{{name}}</a> </li> </ul> <br /> <br /> <input type=”text” style=”width:275px;margin-top:5px;” class=”form-control form-control-sm form-control-rounded” placeholder=”Search…” ng-model=”search”> <br /> <br /> <div class=”panel-body”> <div class=”cui-ecommerce–catalog”> <div class=”row”> <div ng-repeat=”(name, text) in textures”> <div ng-repeat=”url in text”> <div> {{url.url}} <a href=”javascript: void(0);” style=”cursor:default;”> <img ng-src=”{{url.url }}” /> </a> </div> </div> </div> </div> </div> </div> </div> What i want – to […]

Angularjs smart-table search filter like bootstrap datatable search

Help me achieve this feature of search filtering like this attached picture using stSearch, the sample below uses regex in order to allow it’s input to search through rows having rambled or with spaces. What i have tried was creating my Own Directive, but don’t know where to attached the code for search through all columns for possible match. App.directive(‘mySearch’, [‘stConfig’, ‘$timeout’,’$parse’, function (stConfig, $timeout, $parse) { return { require: ‘^stTable’, scope: { predicate: ‘=?mySearch’ […]

How to force a filter to be stateless in angularjs

I am maintaining a site developed with angularjs. There is one filter in the site, that takes two parameters. One of the parameters (the second) is a array. I can guarantee that this parameter will never mutate. It is treated as a inmutable array. If for some reason it changes, a simple reference check would be enough. (and I am almost certain that will never mutate in the life of the view where the pipe […]

GroupBy filter is not working in angularJs

I have created a table in angularjs. Now I am trying to group the table rows based on a column value whose title is “source”. For that, I am using groupBy filter. It is not giving any error. But it is displaying empty rows now. Can someone tell me where I am going wrong? Below is my code: <table> <thead> <tr> <th>Metric</th> <th>Source</th> <th class=”value”>Value</th> <th></th> </tr> </thead> <tr ng-repeat=”metric in metrics | filter:query | […]

Multiple filter value OR operation

I have this plunker how can I display all the search in respective input? This is the code <input type=”text” ng-model=”search” placeholder=”search name, age or gender”><br/> <input type=”text” ng-model=”name.name” placeholder=”search name”><br/> <input type=”text” ng-model=”age.age” placeholder=”search age”><br/> <input type=”text” ng-model=”gender.gender” placeholder=”search gender”><br/> <ul> <li ng-repeat=”item in list | filter:search | filter:name | filter:age | filter: gender”> {{item.name}} {{item.age}} {{item.gender}} </li> </ul> This is what I tried so far <ul> <li ng-repeat=”item in list | (filter:search || […]

Next Page »