从列表中访问属性

时间:2015-12-18 07:38:38

标签: angularjs

我想在项目中访问期间作为选择标记中的选项。

angular js模块和列表

<android.support.v7.widget.RecyclerView
    android:id="@+id/recycler_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@+id/seperator"
    android:columnWidth="100dp"
    android:padding="10dp"/>

选择标记的HTML代码

     var dynamicApp = angular.module('dynamicApp', []);  
       dynamicApp.controller('maincontroller', function($scope) {
    $scope.invoice = {
    items: [{
         loyality: [{name:'points'},{name:'credits'}],
         value:1,
    period: [{name:'activity1'},{name:'activity2'}]
        }]
  };
      $scope.removeItem = function(index) {
    $scope.list.splice(index, 1);
   }    

    });

2 个答案:

答案 0 :(得分:1)

以下是HTML代码:

{{1}}

还有一个工作示例:

http://plnkr.co/edit/OZxcsMIVDs78Jbama174?p=preview

答案 1 :(得分:0)

<td>
<select ng-model=" pts"  ng-options="lists for lists in invoice.items.period  " ></select>
</td>