【问题标题】:How can I catch the ng-model value into sortable options [ui-sortable]如何将 ng-model 值捕获到可排序选项中 [ui-sortable]
【发布时间】:2014-06-05 00:30:19
【问题描述】:

我有这个 html:

<div ng-repeat="item in items">   
  <ul ui-sortable="sortableOptions" ng-model="item.levels">
       <li  ng-repeat="level in item.levels" >
          <ul>
            <li>{{level.title}}</li>
           </ul>
        </li>   
    </ul> 
</div>

我想将 ng-model 值捕获到 sortableOption 中以在数据库中进行顺序更改 sortableOption 将如下进入控制器:

$scope.sortableOptions = {
  update: function (e, ui) {
    console.log('How can I catch the ng-model value?');
  }
};

【问题讨论】:

    标签: javascript jquery angularjs jquery-ui


    【解决方案1】:

    你可以使用:

    $('[ui-sortable="sortableOptions"]').attr('ng-model')
    

    【讨论】:

      猜你喜欢
      • 2023-04-07
      • 1970-01-01
      • 2015-03-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-01
      • 1970-01-01
      • 2020-07-14
      相关资源
      最近更新 更多