Q:

how to _.flatten with a parent array and an array nested ? (lodash)

I have an array named sports and inside that array is another one called leagues but I need those arrays become _.flatten because I am having an issue with the Angular filters.
look at the data, inside the 1st array which contains a "name":"Live Betting" there is another array named "leagues" those are the arrays that I am talking about.
[
  {
    "id": 26,
    "name": "LIVE Betting",
    "priority": 0,
    "leagues": [
      {
        "id": 3042,
        "parent": 1000,
        "name": "LIVE BETTING - NBA",
        "sport": {
          "id": 26,
          "name": "LIVE Betting"
        },
        "lineType": "G",
        "priority": [
          0,
          0
        ],
        "part": "0"
      },
      ...

and this is the resolve with a promise that is returning that array, as you know that data is returned by Sports
      resolve: {
        Sports: function(SportsFactory, AuthFactory, $q) {
          var defer = $q.defer();
          AuthFactory.getCustomer().then(function(customer) {
            SportsFactory.getSportsWithLeagues(customer).then(function(sports) {                  
              defer.resolve(sports);
            });
          });
          return defer.promise;
        }
      }

and here the controller where I call the resolver Sports
  .controller('SportsController', function($scope, AuthFactory,
               SportsFactory, Sports) {
    console.log(angular.toJson(Sports, 'pretty'));
    $scope.sports = [];
    $scope.sportPromise = Sports;

here is a Plunkr for you to check it easier http://plnkr.co/edit/FJ45nV6gdwp3SkRglPeW?p=info

A:

I'm not sure I completely understand what you're looking for but I think you can do the following.
Add a function in your controller to create the flattened array:   
 $scope.leagues = function(){
  var allLeagues = [];
  _.each(mySports, function(sport){
    allLeagues.push.apply(allLeagues, sport.leagues);
  });
  return allLeagues;
};

Then you can bind to the leagues function:    
<div ng-repeat="league in leagues() | filter:query">
  {{league.name}}
</div>

