我试图在我的ion-google-place指令中提交ng模型,但它始终记录未定义
视图:
<form ng-submit="submit()">
<ion-google-place placeholder="Enter Address" ng-model="location" geocode-options="geocodeOptions"/>
<button ng-click="submit()">Submit</button>
</form>
控制器:
$scope.submit = function(){
var location = $scope.location;
console.log(location);
}
答案 0 :(得分:0)
查看:
<form ng-submit="submit(location)">
<ion-google-place placeholder="Enter Address" ng-model="location" geocode-options="geocodeOptions"/>
<button ng-click="submit(location)">Submit</button>
</form>
控制器:
$scope.submit = function(location) {
var loc = location;
console.log(loc);
}
这应该有用。