0

次を使用してリスト(list.html内)をフィルタリングしようとしています:

<div ng-repeat="event in events | filter:filter | orderBy:order">

そして、ListController内にフィルターダイアログがあります

.controller('ListController', ['$scope', '$dialog', function($scope,$dialog) {
  $scope.filterDialog = function() {
      var dlg = $dialog.dialog({
          templateUrl: 'pages/filter.html',
          controller: 'FilterController'
      });
  };

}])

また、filter.html には以下が含まれます。

<form id="filter-form">
  <fieldset>
    <legend>Filter</legend>
        <label>Name:</label>
        <input type="text" ng-model="filter.name">
        <label>Description:</label>
        <input type="text" ng-model="filter.description">
    <div id="sort_section">
        <label>Sort By:</label>
        <label class="radio">
            <input type="radio" name="sort_by" value="time" ng-model="order.time" ng-checked="true" /> Time
        </label>
        <label class="radio">
            <input type="radio" name="sort_by" value="distance" ng-model="order.name" /> Name
        </label>
    </div>
    <button type="submit" class="btn" ng-click="close(filter,order)">Submit</button>
  </fieldset>
</form>

リストにバインドされていないように見えるため、リストはフィルタリングされません。
ここで何が欠けていますか?

更新
上記のコードを変更しました (ng-click="close()" 呼び出しにパラメーターを追加しました)。 パーツを削除した場合にのみ、「注文」を取得できることに
気付きました。type="radio"

更新
それはng-checked="true"ピースです。削除すると、フィルターピースがうまくいきました。

4

1 に答える 1