Set default value for dropdownlist using angularjs?

后端 未结 2 625
臣服心动
臣服心动 2021-01-17 04:23

I have code that populates then dropdownlist and the javascript variable that gets the last item in the list. Now all I want to do is select that last item as the default .W

2条回答
  •  不要未来只要你来
    2021-01-17 05:02

    You simply need to asign a value to congressFilter in your controller.

     $scope.congressFilter = 'someVal';
    

    It depends a little on how your data looks however.

提交回复
热议问题