Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我按照这个文档进行md-select初始值设置。但我想md-select通过按钮以编程方式设置值。
md-select
这是我到目前为止所做的演示
md-select期望对象值存在selectedUser,其中filter返回过滤对象的数组。您应该通过[0]过滤结果分配过滤数组的第一个元素。
selectedUser
filter
[0]
$scope.selectedUser = $scope.users.filter(function(user) { return user.id == id; })[0];
分叉的 Codepen