AngularJS ng-options와 ng-repeat

· 8년 전 · 1405
AngularJS ng-options와 ng-repeat

이 ng-repeat지시문을 사용하여 동일한 드롭 다운 목록을 만들 수도 있습니다 .


<select>
<option ng-repeat="x in names">{{x}}</option>
</select>

<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>

<div ng-app="myApp" ng-controller="myCtrl">

<select>
<option ng-repeat="x in names">{{x}}</option>
</select>

</div>

<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.names = ["Emil", "Tobias", "Linus"];
});
</script>

<p>This example shows how to fill a dropdown list using the ng-repeat directive.</p>

</body>
</html>
|
댓글을 작성하시려면 로그인이 필요합니다. 로그인

퍼블리싱강좌

+
분류 제목 글쓴이 날짜 조회
AngularJS
[AngularJS]
8년 전 조회 1,507
AngularJS
[AngularJS]
8년 전 조회 1,494
AngularJS
[AngularJS]
8년 전 조회 1,036
AngularJS
[AngularJS]
8년 전 조회 1,414
AngularJS 8년 전 조회 1,306
AngularJS 8년 전 조회 1,282
AngularJS 8년 전 조회 1,455
AngularJS 8년 전 조회 1,229
AngularJS 8년 전 조회 1,289
AngularJS 8년 전 조회 1,390
AngularJS 8년 전 조회 1,156
AngularJS 8년 전 조회 1,899
AngularJS 8년 전 조회 1,454
AngularJS 8년 전 조회 1,137
AngularJS 8년 전 조회 1,406
AngularJS 8년 전 조회 1,200
AngularJS 8년 전 조회 1,017
AngularJS 8년 전 조회 1,983
AngularJS 8년 전 조회 1,055
AngularJS 8년 전 조회 1,116
AngularJS 8년 전 조회 1,309
AngularJS 8년 전 조회 1,149
AngularJS 8년 전 조회 1,367
AngularJS 8년 전 조회 1,374
AngularJS 8년 전 조회 1,134
AngularJS 8년 전 조회 1,097
AngularJS 8년 전 조회 1,513
AngularJS 8년 전 조회 1,487
AngularJS 8년 전 조회 1,327
AngularJS 8년 전 조회 1,217
🐛 버그신고