A
A
Abc Edc2015-03-09 18:20:17
Angular
Abc Edc, 2015-03-09 18:20:17

How to make filters dynamic angular js?

That is, so that when outputting, do not do HTML in advance.
For example, when displaying some categories

<div class="item" ng-repeat="item in teams | filter: {c_name :'Food'}" ng-show="items">
            <div class="row">
   
            </div>
        </div>
<div class="item" ng-repeat="item in teams | filter: {c_name :'clothing'}" ng-show="items">
            <div class="row">
   
            </div>
        </div>
<div class="item" ng-repeat="item in teams | filter: {c_name :'и так далее'}" ng-show="items">
            <div class="row">
   
            </div>
        </div>

but do it once
<div class="item" ng-repeat="item in teams | filter: {c_name :'функция супер динамичная'}" ng-show="items">

And here, so that it itself allows the elements of each category to be scrolled once

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-03-09
@gleber1

Don't you think that such things should be done at least in the controller? Or make your own filter that will ruin everything inside.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question