ng-model使用ng-repeat而不是collection-repeat

时间:2015-06-21 21:58:06

标签: javascript angularjs cordova ionic-framework ionic

我正在执行下面的代码,它适用于ng-repeat但不适用于collection-repeat:

<ul collection-repeat="line in lines">
        <li class="line-item">
            <ion-radio class="line-item" ng-model="displayLine" ng-value="{{line.id_linha}}" ng-change="serverSideChange(line)" >
          <div class="line-number">{{line.numero}}</div>
          <div class="line-name">{{line.nome}}</div>
        </ion-radio>
        </li>
    </ul>
<div class="control-panel">
        <a class="button center" ng-click="drawLines(displayLine)" href="#/app/playlists">
          <span>VER NO MAPA</span>
        </a>
    </div>
我错过了什么?我想让它工作,但我在drawLines中未定义 ng-change不起作用,我想要的只是将数据发送到drawLines

控制器:

$scope.serverSideChange = function(line){
    $scope.displayLine = line;
  };
$scope.drawLines = function(line){ console.log(line); }

0 个答案:

没有答案