小编Sam*_*wis的帖子

关于ng的Angular JS Action - 更改选择下拉列表

我有一个简单的表,每行有三行和两个值 - 日期和状态:

<tbody>
   <tr>
      <td>Red</td>
        <td class="lastModified">{{item.redDate}}</td>
        <td class="status"> 
            <select id ="red" class="form-control" ng-change="update();" ng-model="item.redStatus">
              <option value="" disabled="" selected="" class="ng-binding">Please select the value</option>
              <option ng-selected="step.value === item.redStatus"  ng-repeat="(key, step) in steps">{{ step.title }}</option>
            </select>
       </td>
   </tr>
   <tr>Green</tr>
   <tr>
     ....
   </tr>                    
</tbody>
Run Code Online (Sandbox Code Playgroud)

因此,红色,绿色和蓝色的简单日期和状态值.一个在下拉列表中 - 状态,第二个 - 只是输出日期.

在更改选择值时 - 我需要使用今天的日期更新日期.

 `$scope.item.redDate = new Date();`
Run Code Online (Sandbox Code Playgroud)

是否有可能有一个功能,如ng-change="change();" 无法发送与更改ID ...

select scope angularjs angularjs-ng-change

7
推荐指数
1
解决办法
5万
查看次数

标签 统计

angularjs ×1

angularjs-ng-change ×1

scope ×1

select ×1