2016-06-27 1 views
0

ng-model을 textarea에 적용하고 있지만 11에 오류가 있습니다. 내 코드는 다음과 같습니다.ng-model의 대안 찾기

<div ng-hide="DoctorDashboardCtrl.showEducation"> 
     <textarea placeholder="2000 Characters Free flow text" width="832px" height="100px" class="form-control" ng-model="DoctorDashboardCtrl.otherdetails.education"> 
      <!-- {{DoctorDashboardCtrl.otherdetails.education}} -->  
     </textarea> 
</div> 

ie11에서 잘못된 인수로 오류가 발생했습니다. 나는

<div ng-hide="DoctorDashboardCtrl.showEducation"> 
    <textarea placeholder="2000 Characters Free flow text" width="832px" height="100px" class="form-control" ng-bind="DoctorDashboardCtrl.otherdetails.education"> 
      {{DoctorDashboardCtrl.otherdetails.education}} 
    </textarea> 
</div> 

에 코드를 변경하지만 지금, 나는 DoctorDashboardCtrl.otherdetails.education의 값을 인쇄 할 때 저장 버튼에 cicking 후에는 업데이트 점점되지 않고 대신은 이전 값을 보이고있다. 이 문제에 대한 다른 해결책이 있습니까? 아니면 오류가 영원히 지속되도록 노력해야합니까?

+0

어떤 오류가 발생합니까? – str

+0

컨트롤러 코드를 공유 할 수 있습니까? – Thinker

+0

@str 오류 : 인수가 잘못되었습니다. interpolateFnWatcher (https : // localhost : 8443/assets/lib/angular/angular.js : 12020 : 0)에서 (interp : // localhost : 8443/17) watchgroupAction (https : // localhost : 8443/assets/lib/angular/angular.js : 16539 : 13) (Scope.prototype에서) $ digest (https : // localhost : 8443/assets/lib/angular . /angular.js:16869:23) Scope.prototype에서 $이 적용됩니다 (https : //로 로컬 호스트 : 8443/자산/lib 디렉토리/각/angular.js : 17133 : 13) requestLoaded –

답변

0

@Gaurav : 당신이 업데이트받을 수 있도록 값을 코드에서

`$scope.$watch(
      function(){ 
       return $scope.otherdetails.education; 
      }, 
      function(newValue, oldValue){ 
       if(newValue && newValue != oldValue) { 
        $scope.otherdetails.education = newValue; 
       } 
      }, 
      true 
     );` 

을 시계를 추가하고 또한 컨트롤러의 시작에 빈 배열과 문자열을 할당합니다

$scope.otherdetails = []; $scope.otherdetails.education = "";

+0

otherdetails가 제 경우의 객체입니다. 나는 당신의 솔을 시도했지만 그것이 작동하지 않습니다 –

+0

이 링크를 확인하십시오 http://fiddle.jshell.net/bd5cyxef/ – Neha

+0

네,이 코드는 완벽하게 잘 작동합니다. 하지만 Internet Explorer에서이 바이올린을 실행하려고하면 오류가 표시되고 코드가 작동합니다. 저스틴 콘솔 열어. –