在md-select更改时调用angularJS函数

时间:2017-02-03 05:36:54

标签: angularjs

我是angularJS的新手,想要在更改md-select后调用一个函数。以下是我的代码:

    function filterCompanyList() {
        alert(1);
    };
    $scope.filterCompanyList = filterCompanyList;

AngularJS:

<div class="col-xs-2 col-xs-offset-1">.col-xs-2 .col-xs-offset-1</div>

我想调用&#34; filterCompanyList()&#34;每当我改变md-option时。但它不起作用。我该怎么做?我无法找到问题。

提前致谢。

1 个答案:

答案 0 :(得分:1)

更改

ng-change="filterCompanyList();"

$scope.filterCompanyList = function() {
    alert(1);
};

["C","Python","Swift","Ruby","Javascript","PHP","C#","Java"]