angularjs怎么获得ng-model里的value
展开全部
<div class="page-content" ng-app="Example" ng-controller="ExampleCtr">
<input type="text" id="keyWords" ng-model="pageModel.keyWords" class="form-control" placeholder="请输入关键词" />
</div>
.controller("ExampleCtr", [ '$scope', "httpServer", function ($scope, httpServer) {
$scope.pageModel = {
keyWords: ""
};
var value = $scope.pageModel.keyWords;
}])
<input type="text" id="keyWords" ng-model="pageModel.keyWords" class="form-control" placeholder="请输入关键词" />
</div>
.controller("ExampleCtr", [ '$scope', "httpServer", function ($scope, httpServer) {
$scope.pageModel = {
keyWords: ""
};
var value = $scope.pageModel.keyWords;
}])
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询