我试图通过更改选择来更新filterTable的值。但价值没有得到更新。
准确地说,对更改功能的调用没有通过。 - 我能够在html页面中访问filterTable的值,但不能访问函数。
有人可以帮我解决这个问题。
控制器:
<script type="text/javascript">
var app = angular.module('cips', []);
app.controller('manageFieldsCtrl', ['$scope', function($scope) {
$scope.filterTable = "";
$scope.change = function () {
alert("changed!");
$scope.filterTable = $scope.ddlSource;
}
}]); </script>
2 .html文件:
<div ng-app="cips" ng-controller="manageFieldsCtrl"
class="container" style="padding-left: 10px;">
<h4> {{pageTitle}} </h4> <br>
<!-- Pick a field from dropdown to display the list of values for the selected field. -->
<div class="row">
<div class="input-field col s3">
<select required id="fieldList" ng-model="ddlSource" ng-change="change()">
<option value="" selected>Choose your option</option>
<option *ngFor="let fund of funds | unique : 'Type'" value={{fund.Look_Up_ID}} > {{fund.Type}} </option>
</select>
<label>Select the Field Type</label>
</div><br><br>
</div> </div>