一:使用ng-model进行双向绑定无效案例
1.在html中
<input type="text" placeholder="搜索" ng-model="password">
2.在controller中无法取到值
console.log($scope. password);
二:解决方案就是将password放在user对象
1.html中paasword换成下面形式user.password
<input type="text" placeholder="搜索" ng-model="user.password">
2.在controller中定义对象user,将password放进去就可以了
$scope.user = {};
console.log($scope.user.password);