선택 상자
선택 상자
ng-model 지시문 을 사용하여 응용 프로그램에 선택 상자를 바인딩하십시오 .
속성에 정의 된 ng-model속성은 선택 상자에서 선택한 옵션의 값을 갖습니다.
예
선택한 옵션의 값에 따라 텍스트를 표시하십시오.
<form>
Select a topic:
<select ng-model="myVar">
<option value="">
<option value="dogs">Dogs
<option value="tuts">Tutorials
<option value="cars">Cars
</select>
</form>
myVar에의 값이 될 것이다 dogs, tuts또는 cars.
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body ng-app="">
<form>
Select a topic:
<select ng-model="myVar">
<option value="">
<option value="dogs">Dogs
<option value="tuts">Tutorials
<option value="cars">Cars
</select>
</form>
<div ng-switch="myVar">
<div ng-switch-when="dogs">
<h1>Dogs</h1>
<p>Welcome to a world of dogs.</p>
</div>
<div ng-switch-when="tuts">
<h1>Tutorials</h1>
<p>Learn from examples.</p>
</div>
<div ng-switch-when="cars">
<h1>Cars</h1>
<p>Read about cars.</p>
</div>
</div>
<p>The ng-switch directive hides and shows HTML sections depending on the value of the dropdown list.</p>
</body>
</html>
ng-model 지시문 을 사용하여 응용 프로그램에 선택 상자를 바인딩하십시오 .
속성에 정의 된 ng-model속성은 선택 상자에서 선택한 옵션의 값을 갖습니다.
예
선택한 옵션의 값에 따라 텍스트를 표시하십시오.
<form>
Select a topic:
<select ng-model="myVar">
<option value="">
<option value="dogs">Dogs
<option value="tuts">Tutorials
<option value="cars">Cars
</select>
</form>
myVar에의 값이 될 것이다 dogs, tuts또는 cars.
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body ng-app="">
<form>
Select a topic:
<select ng-model="myVar">
<option value="">
<option value="dogs">Dogs
<option value="tuts">Tutorials
<option value="cars">Cars
</select>
</form>
<div ng-switch="myVar">
<div ng-switch-when="dogs">
<h1>Dogs</h1>
<p>Welcome to a world of dogs.</p>
</div>
<div ng-switch-when="tuts">
<h1>Tutorials</h1>
<p>Learn from examples.</p>
</div>
<div ng-switch-when="cars">
<h1>Cars</h1>
<p>Read about cars.</p>
</div>
</div>
<p>The ng-switch directive hides and shows HTML sections depending on the value of the dropdown list.</p>
</body>
</html>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 208 | 부트스트랩 | 8년 전 | 2720 | ||
| 207 | AngularJS | 8년 전 | 1461 | ||
| 206 | AngularJS | 8년 전 | 1112 | ||
| 205 | AngularJS | 8년 전 | 985 | ||
| 204 | AngularJS | 8년 전 | 1386 | ||
| 203 | AngularJS | 8년 전 | 1183 | ||
| 202 | AngularJS | 8년 전 | 1499 | ||
| 201 | AngularJS | 8년 전 | 1448 | ||
| 200 | AngularJS | 8년 전 | 1421 | ||
| 199 | AngularJS | 8년 전 | 1345 | ||
| 198 | AngularJS | 8년 전 | 1227 | ||
| 197 | AngularJS | 8년 전 | 1389 | ||
| 196 | AngularJS | 8년 전 | 1043 | ||
| 195 | AngularJS | 8년 전 | 1254 | ||
| 194 | AngularJS | 8년 전 | 1267 | ||
| 193 | AngularJS | 8년 전 | 1613 | ||
| 192 | AngularJS | 8년 전 | 1359 | ||
| 191 | AngularJS | 8년 전 | 1584 | ||
| 190 | AngularJS | 8년 전 | 1550 | ||
| 189 | AngularJS | 8년 전 | 1641 | ||
| 188 | AngularJS | 8년 전 | 1397 | ||
| 187 | AngularJS | 8년 전 | 1367 | ||
| 186 | AngularJS | 8년 전 | 1400 | ||
| 185 | AngularJS | 8년 전 | 1434 | ||
| 184 | AngularJS | 8년 전 | 1477 | ||
| 183 | AngularJS | 8년 전 | 1471 | ||
| 182 | AngularJS | 8년 전 | 1008 | ||
| 181 | AngularJS | 8년 전 | 1386 | ||
| 180 | AngularJS | 8년 전 | 1277 | ||
| 179 | AngularJS | 8년 전 | 1250 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기