Skip to main content
2 de 6
removeu 109 caracteres do conteúdo
novic
  • 36,7mil
  • 4
  • 32
  • 70

var app = angular.module("app", []);
app.controller("ctrl", function($scope, $filter) {
  $scope.dropItens1 = [{
      'value': 1,
      'text': 'Tenis'
    },
    {
      'value': 2,
      'text': 'Roupa'
    }
  ];
  
  //$scope.dropSelected1 = {};
  //$scope.dropSelected2 = {};
  
  $scope.dropItens2 = [{
      'value': 1,
      'text': 'Adidas'
    },
    {
      'value': 1,
      'text': 'Olimpikus'
    },
    {
      'value': 2,
      'text': 'Camiseta'
    },
    {
      'value': 2,
      'text': 'Calça'
    }
  ];
 });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>

<div ng-app="app" ng-controller="ctrl">
  <select ng-options="item1.value as item1.text for item1 in dropItens1" ng-model="dropSelected1">  
  </select>

  <select ng-options="item2.value as item2.text for item2 in dropItens2 | filter:{ value : dropSelected1.value }" ng-model="dropSelected2">  
  </select>

</div>

novic
  • 36,7mil
  • 4
  • 32
  • 70