2014-04-05 3 views
0

angularJS (v.1.2.15)와 함께 typeahead (ngSstrap : http://mgcrea.github.io/angular-strap/##typeaheads)를 사용하려고합니다. 나는 다음과 같은 오류가 (목록이 표시되지만 그것은 비어) :각도 생성 동적 항목에 AngularJS가 작동하지 않습니다.

Error: [$sce:unsafe] Attempting to use an unsafe value in a safe context. 
http://errors.angularjs.org/1.2.15/$sce/unsafe 
minErr/<@http://localhost:50445/Scripts/angular.js:78 
[email protected]://localhost:50445/Scripts/angular.js:12790 
[email protected]://localhost:50445/Scripts/angular.js:12954 
@http://localhost:50445/Scripts/angular.js:13635 
[email protected]://localhost:50445/Scripts/angular.js:17671 
$RootScopeProvider/this.$get</[email protected]://localhost:50445/Scripts/angular.js:12031 
this.$get/TooltipFactory/[email protected]://localhost:50445/Scripts/angular-strap-tooltip.js:196 
this.$get/TypeaheadFactory/[email protected]://localhost:50445/Scripts/angular-strap-typeahead.js:131 
this.$get/TooltipFactory/[email protected]://localhost:50445/Scripts/angular-strap-tooltip.js:164 
[email protected]://localhost:50445/Scripts/jquery-2.1.0.js:4371 
jQuery.event.add/[email protected]://localhost:50445/Scripts/jquery-2.1.0.js:4057 
this.$get/TooltipFactory/[email protected]://localhost:50445/Scripts/angular-strap-tooltip.js:292 
[email protected]://localhost:50445/Scripts/jquery-2.1.0.js:4371 
jQuery.event.add/[email protected]://localhost:50445/Scripts/jquery-2.1.0.js:4057 

http://localhost:50445/Scripts/angular.js 
Line 9563 

을 내가 NG 반복으로 생성 된 상자를 클릭 경우에만 발생합니다. 내가 직접 입력 (다음 코드의 마지막 줄)을 작성하면 모든 것이 정상입니다. 오류가 없으며 제안 사항이 표시됩니다. 관련 코드 :

<div class="control-group children-horizontal repeat-item" data-ng-repeat="passenger in passengers"> 
      <!--label class="control-label" for="textinput">Departure from</label--> 
      <!--span class="fleft"> 
       {{$index + 1}}. 
      </span--> 
      <div class="controls"> 
       <div class="input-group"> 
        <input name="airports[{{$index}}]" value="{{passenger.from}}" placeholder="Departure from" class="form-control input-xlarge" type="text" data-ng-model="selectedAirport" data-min-length="0" data-html="1" data-animation="am-flip-x" data-ng-options="airport for airport in airports" data-bs-typeahead="" autocomplete="off" /> 
        <span class="input-group-btn"><button type="button" class="btn" data-ng-click="removePassenger($index)"><i class="fa fa-minus"></i></button></span> 
       </div>     

      </div> 
     </div> 

     <div class="control-group"> 
      <div class="controls"> 
      <button type="button" class="btn" data-ng-click="addPassenger()"><i class="fa fa-plus"></i> Add new passenger</button> 
      <button class="btn btn-search btn-primary"><i class="fa fa-search"></i> Search for flights</button> 
      </div> 
</div> 

<input placeholder="Departure from" class="form-control" data-animation="am-flip-x" data-ng-model="selectedAirport" data-ng-options="airport for airport in airports" data-bs-typeahead="" type="text" /> 

누군가이 오류의 원인을 알고 있습니까?

답변

관련 문제