title: Two dropdown filters. The first determines the info in the second
body: <p>I'm not sure how to build this although I've spent several hours trying. My code seems somewhat close but I'm unable to pass my selection from the HTML back to the controller.</p>
  
  <p>My Angular code:</p>
  
  <pre><code> var Categories = Parse.Object.extend("bizCategories");
  
          $scope.categories = [
              {category: "Food and Drink"},
              {category: "Healthcare"},
              {category: "Recreation"},
              {category: "Service"},
              {category: "Shops"},
              {category: "Travel"}
          ]
  
          $scope.setPrimary = function (category) {
              $scope.offer.primary = category;
              $scope.secondaryCategories(category);
          };
  
          $scope.secondaryCategories = function(category){
              var Secondary = new Parse.Query(Categories);
              Secondary.limit(1000);
              Secondary.find({
                  success:function(list){
                      $scope.SecondaryCategories = _.uniq(_.filter(_.map(list, function(item){
                          return{primary: item.get('secondary')
                          }}
                      )),'primary',true)
                      console.log($scope.SecondaryCategories);
                  },
                  error: function(error){alert("A mistake was made.");
                  }
              })
          }
  </code></pre>
  
  <p>My html:</p>
  
  <pre><code>  &lt;select id= 'primary' ng-model="offer.primary" ng-options="XXX.category for XXX in categories"
                  ng-click= setPrimary(category)&gt;
              &lt;option value=""&gt;Primary Business Category&lt;/option&gt;
          &lt;/select&gt;
  
          &lt;select id= 'secondary' ng-model="offer.secondary" ng-disabled="!offer.primary"
                  ng-options="XXX.category for XXX in SecondaryCategories" ng-click="setSecondary('XXX.category')"&gt;
              &lt;option value=""&gt;Secondary Business Category&lt;/option&gt;
          &lt;/select&gt;
  </code></pre>
  
  <p>You'll see that I picked XXX in my html for ng-options. I picked that because from what I can tell from the tutorials, the purpose to call it anything in particular is arbitrary and I made this XXX as a not on that matter. Also, I need info from the first dropdown to carry over to the function for the second dropdown (category) but that is showing up as undefined. </p>
  
  <p>The data source:</p>
  
  <p><img src="https://i.stack.imgur.com/vRcGg.png" alt="Primary is the first selection criteria and exists as array in the first controller. Secondary is filtered using primary; it&#39;s a many to many relationship."></p>