AngularJS可排序无法读取null的属性'ngModel'

时间:2018-12-20 08:57:19

标签: angularjs angular-ui-sortable

我正在尝试使用angularjs中的sortable拖放卡,但是ngModel存在一些问题。null我该如何解决?

列表是对象数组的数组 而阶段是对象数组

  <div class="ibox-content animate fadeOut">

<div ng-repeat="row in opportunities.stages">
  <div class="stage stage-{{row.StageId}}" ng-if="row.StageId !== 100">


    <div id="{{row.StageId}}" class="stage-lane" ui-sortable="opportunities.sortableOptions" ng-model="opportunities.lists[$index]"  ng-show="!opportunities.load">
      <div ng-repeat="opportunity in opportunities.lists[$index]>
        <div class="opportunity" date-id="opportunity.OpportunityId">
          <div class="title">{{opportunity.Title ? opportunity.Title : opportunity.CustomerCompanyName}}

          </div>
          <div class="status"></div>
          <div class="closing" ng-show="opportunity.StageId < 10">{{opportunity.ExpectedClosingDate}}</div>
          <div class="closing" ng-show="opportunity.StageId >= 10">{{opportunity.ActualClosingDate}}</div>
          <div class="value">{{opportunity.Value}}</div>
          <div class="company">{{opportunity.CustomerCompanyName}}</div>

        </div>
      </div>
    </div>

  </div>

  <div class="stage stage-{{row.StageId}}" ng-if="row.StageId === 100">

      <div id="stage-{{row.StageId}}" class="stage-lane">

      </div>
  </div>
</div>

Controller

vm.sortableOptions = {
  connectWith: ".stage-lane:not(#stage_100)",
  items : ".opportunity",
  distance: 5,
  forcePlaceholderSize: true,
  tollerance: "pointer",
  placeholder: "sortable-placeholder", 
  receive: setStage
};

0 个答案:

没有答案