AngularJS 선택 상자
AngularJS 선택 상자
AngularJS를 사용하면 배열 또는 객체의 항목을 기반으로 드롭 다운 목록을 만들 수 있습니다.
ng-options를 사용하여 선택 상자 만들기
AngularJS의 객체 또는 배열을 기반으로 드롭 다운 목록을 만들려면 다음 ng-options지시문을 사용해야합니다 .
예
<div ng-app="myApp" ng-controller="myCtrl">
<select ng-model="selectedName" ng-options="x for x in names">
</select>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.names = ["Emil", "Tobias", "Linus"];
});
</script>
<!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 ng-model="selectedName" ng-options="x for x in names">
</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-options directive.</p>
</body>
</html>
AngularJS를 사용하면 배열 또는 객체의 항목을 기반으로 드롭 다운 목록을 만들 수 있습니다.
ng-options를 사용하여 선택 상자 만들기
AngularJS의 객체 또는 배열을 기반으로 드롭 다운 목록을 만들려면 다음 ng-options지시문을 사용해야합니다 .
예
<div ng-app="myApp" ng-controller="myCtrl">
<select ng-model="selectedName" ng-options="x for x in names">
</select>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.names = ["Emil", "Tobias", "Linus"];
});
</script>
<!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 ng-model="selectedName" ng-options="x for x in names">
</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-options directive.</p>
</body>
</html>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 88 | jQuery Mobile | 8년 전 | 1942 | ||
| 87 | jQuery Mobile | 8년 전 | 1928 | ||
| 86 | jQuery Mobile | 8년 전 | 1534 | ||
| 85 | jQuery Mobile | 8년 전 | 1844 | ||
| 84 | jQuery Mobile | 8년 전 | 1882 | ||
| 83 | jQuery Mobile | 8년 전 | 1897 | ||
| 82 | jQuery Mobile | 8년 전 | 1663 | ||
| 81 | jQuery Mobile | 8년 전 | 1377 | ||
| 80 | jQuery Mobile | 8년 전 | 1813 | ||
| 79 | jQuery Mobile | 8년 전 | 1362 | ||
| 78 | jQuery Mobile | 8년 전 | 1759 | ||
| 77 | jQuery Mobile | 8년 전 | 1786 | ||
| 76 | jQuery Mobile | 8년 전 | 1794 | ||
| 75 | jQuery Mobile | 8년 전 | 1409 | ||
| 74 | jQuery Mobile | 8년 전 | 1549 | ||
| 73 | jQuery Mobile | 8년 전 | 1252 | ||
| 72 | jQuery Mobile | 8년 전 | 1634 | ||
| 71 | jQuery Mobile | 8년 전 | 1626 | ||
| 70 | jQuery Mobile | 8년 전 | 1510 | ||
| 69 | jQuery Mobile | 8년 전 | 1515 | ||
| 68 | jQuery Mobile | 8년 전 | 2052 | ||
| 67 | jQuery Mobile | 8년 전 | 1321 | ||
| 66 | jQuery Mobile | 8년 전 | 1698 | ||
| 65 | jQuery Mobile | 8년 전 | 1191 | ||
| 64 | jQuery Mobile | 8년 전 | 1473 | ||
| 63 | jQuery Mobile | 8년 전 | 1666 | ||
| 62 | jQuery Mobile | 8년 전 | 1650 | ||
| 61 | jQuery Mobile | 8년 전 | 1886 | ||
| 60 | jQuery Mobile | 8년 전 | 1417 | ||
| 59 | jQuery Mobile | 8년 전 | 1971 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기