P
P
Postraner2016-02-03 20:14:38
JavaScript
Postraner, 2016-02-03 20:14:38

What's the best way to make additions?

Hello. Help solve the problem. I don't have much experience with js and angularjs. Faced such a problem, how can I do this so that it is filtered by several values, and not just by one, the example itself: there are several buttons of this type

<button  class="btn btn-default" ng-repeat="route in routes" ng-if="route < 13" ng-class="{'btn-success': route == currentRoute}" ng-click="filterRoute(route)">{{route}}</button>
further filterRoute itself
$scope.filterRoute = function(r) {
              $scope.currentRoute = r;
              transitLineService.setFilter(r);
              layerManagerService.showLayer(transitLineService.ident);
            };

and output
return {
      _filterRoute: null,
      _toggler: function(b) {
        transitTramsService.activate();
        if(b) {
          vehiclesService.setFilterRoute(this._filterRoute);
        } else {
          vehiclesService.setFilterRoute(false);
        }
      },
      setFilter: function(r) {
        this._filterRoute = r;
I apologize if there are any mistakes and stupidity.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
PerfectLab, 2016-02-04
@PerfectLab

I doubt that you will get an answer, the question and the task cannot be understood by pieces of code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question