这是理想的行为,您应该在控制器中而不是在视图中定义模型。
<div ng-controller="Main"> <input type="text" ng-model="rootFolders"></div>function Main($scope) { $scope.rootFolders = 'bob';}
这是理想的行为,您应该在控制器中而不是在视图中定义模型。
<div ng-controller="Main"> <input type="text" ng-model="rootFolders"></div>function Main($scope) { $scope.rootFolders = 'bob';}