修改后的报价:
“如果使用ng-model,则必须在其中有一个点。”
将您的模型指向object.property,您会很顺利。控制者
> $scope.formData = {};> $scope.login = function () {> console.log("User logged in with membership no: " +> $scope.formData.membershipNo +> "n and password: " + $scope.formData.password);> }
模板
> <input type="text" placeholder="Membership No" ng-> model="formData.membershipNo">> <input type="password" placeholder="Password" ng-> model="formData.password">
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)