Angularjs输入字段在输入谷歌浏览器时遇到困难

时间:2015-01-30 12:08:00

标签: angularjs google-chrome ionic-framework

我在表单名字,姓氏,电子邮件,电话中有4个字段 当我开始在电子邮件和电话领域打字时,表格卡在谷歌浏览器浏览器中(键盘输入和鼠标点击表单部分停止工作,但外部形成一切,例如:标签正在工作),但当我尝试使用Firefox时没有问题。

我在Google Chrome中尝试删除firstname字段,现在错误只发生在手机字段中。同样,当我删除姓氏字段时,没有错误。 通常只有前2个字段正在向第3个字段开始显示其显示错误。  我怎么能解决这个问题。



.controller('AccountCtrl', function($scope) {
 
  $scope.usr = {"firstname":"","lastname":"","umail":"","uphone":"","location":["",""]};
  
  if(localStorage.getItem('appusr')!==null){
	  $scope.usr = JSON.parse(localStorage.getItem('appusr'));
	  console.log($scope.usr);
  }  
  $scope.saveUserDetails = function(){
	  if($scope.usr.location[0]==""){
		  if (navigator.geolocation) {
			    navigator.geolocation.getCurrentPosition(function(position){
			      $scope.$apply(function(){	        
			    	  $scope.usr.location = [position.coords.latitude,position.coords.longitude];
			        
			      });
			      
			 });
		  }
	  }
	  console.log($scope.usr);
	  localStorage.setItem("appusr",JSON.stringify($scope.usr));
		  
  }
  
   
});

   <form ng-submit="saveUserDetails()" name="form" validate>
<div class="list">
  <label class="item item-input item-stacked-label">
    <span class="input-label">First Name</span>
    <input type="text" ng-model="usr.firstname" placeholder="John">
  </label>
  <label class="item item-input item-stacked-label">
    <span class="input-label">Last Name</span>
    <input type="text" ng-model="usr.lastname" placeholder="Suhr">
  </label>
  <label class="item item-input item-stacked-label">
    <span class="input-label">Email</span>{{usr.email}}
    <input type="email" ng-model="usr.umail" name="umail" placeholder="john@suhr.com">
   
  </label>
  
   <label class="item item-input item-stacked-label">
    <span class="input-label">Phone</span>
    <input type="text" ng-model="usr.uphone" placeholder="9999999999">
  </label>
  
  
  <button type="submit" class="button button-full button-positive"><i class="icon ion-person-add"></i> &nbsp;&nbsp; Update </button>
</div>

</form>
&#13;
&#13;
&#13;

0 个答案:

没有答案