내 모델에 문자열 배열이 있습니다. 각 문자열에 대한 텍스트 입력을 만들어 Twitter 부트 스트랩을 사용하여 배열에 바인딩하고 싶습니다. 그들과 선견해라. 여기에 내가 시도 것입니다 :ng-repeat를 사용하여 문자열 배열의 각 값에 대한 입력 만들기
여기<div class="control-group inline" ng-repeat="offer in userinfoadd.offers">
<label class="control-label" for="offer">Offer </label>
<div class="controls">
<input type="text" bs-typeahead="typeahead" value="{{offer}}">
</div>
</div>
내 컨트롤러에 코드입니다 :
$scope.userinfoadd = {
offers: ['one','two','three','four','five']
};
//get the typeahead
$http.get('data/activities.json').success(function(data) { //TODO: Stub, replace for an API call!
$scope.typeahead = data;
});
지금 입력 렌더링하지만 그들은 작동하지 않습니다. 어떤 아이디어?
"작동하지 않는다"는 말은 이전 버전이 작동하지 않는다는 의미입니까? –
typeahead가 작동하지만 값을 변경하면 모델을 업데이트하지 않습니다 –