angularjs select ng-options,加载时无法选择正确的选项

时间:2014-07-10 06:55:04

标签: angularjs

JS:

    $scope.tasks = [{ Name: "Deliverable", Id: "Deliverable" },
                    { Name: "Email", Id: "Email" }]
    $scope.currentTask = {Subject: "Deliverable"}

HTML:

<select ng-model="currentTask.Subject" ng-options="task.Id as task.Name for task in tasks"></select>

结果: 页面加载时未选择任何选项。但下拉效果很好。我错过了什么吗? enter image description here

0 个答案:

没有答案