AngularJS 코드 포함
AngularJS 코드 포함
ng-include 지시어에 포함 된 HTML 파일에는 AngularJS 코드도 포함될 수 있습니다.
myTable.htm :
<table>
<tr ng-repeat="x in names">
<td>{{ x.Name }}</td>
<td>{{ x.Country }}</td>
</tr>
</table>
웹 페이지에 "myTable.htm"파일을 포함하면 포함 된 파일 안의 코드도 포함하여 모든 AngularJS 코드가 실행됩니다.
예
<body>
<div ng-app="myApp" ng-controller="customersCtrl">
<div ng-include="'myTable.htm'"></div>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("customers.php").then(function (response) {
$scope.names = response.data.records;
});
});
</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="customersCtrl">
<div ng-include="'myTable.htm'"></div>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("customers.php").then(function (response) {
$scope.names = response.data.records;
});
});
</script>
<p>The HTML, and AngularJS code, for this table are located in the file "myTable.htm".</p>
</body>
</html>
ng-include 지시어에 포함 된 HTML 파일에는 AngularJS 코드도 포함될 수 있습니다.
myTable.htm :
<table>
<tr ng-repeat="x in names">
<td>{{ x.Name }}</td>
<td>{{ x.Country }}</td>
</tr>
</table>
웹 페이지에 "myTable.htm"파일을 포함하면 포함 된 파일 안의 코드도 포함하여 모든 AngularJS 코드가 실행됩니다.
예
<body>
<div ng-app="myApp" ng-controller="customersCtrl">
<div ng-include="'myTable.htm'"></div>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("customers.php").then(function (response) {
$scope.names = response.data.records;
});
});
</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="customersCtrl">
<div ng-include="'myTable.htm'"></div>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('customersCtrl', function($scope, $http) {
$http.get("customers.php").then(function (response) {
$scope.names = response.data.records;
});
});
</script>
<p>The HTML, and AngularJS code, for this table are located in the file "myTable.htm".</p>
</body>
</html>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 298 | CSS |
선택과집중
|
2개월 전 | 164 | |
| 297 | CSS |
선택과집중
|
3개월 전 | 376 | |
| 296 | CSS |
선택과집중
|
3개월 전 | 324 | |
| 295 | CSS |
선택과집중
|
4개월 전 | 302 | |
| 294 | CSS |
선택과집중
|
4개월 전 | 429 | |
| 293 | CSS |
선택과집중
|
4개월 전 | 384 | |
| 292 | CSS |
선택과집중
|
4개월 전 | 297 | |
| 291 | CSS |
선택과집중
|
5개월 전 | 300 | |
| 290 | CSS |
선택과집중
|
5개월 전 | 349 | |
| 289 | CSS |
선택과집중
|
5개월 전 | 318 | |
| 288 | CSS |
선택과집중
|
5개월 전 | 403 | |
| 287 | CSS |
선택과집중
|
5개월 전 | 354 | |
| 286 | CSS |
선택과집중
|
5개월 전 | 354 | |
| 285 | CSS |
선택과집중
|
5개월 전 | 377 | |
| 284 | CSS |
선택과집중
|
5개월 전 | 262 | |
| 283 | CSS |
|
2년 전 | 1533 | |
| 282 | CSS | 2년 전 | 2513 | ||
| 281 | CSS | 4년 전 | 4043 | ||
| 280 | CSS | 4년 전 | 4561 | ||
| 279 | 반응형웹 | 5년 전 | 2990 | ||
| 278 | 반응형웹 | 5년 전 | 2844 | ||
| 277 | 부트스트랩 | 7년 전 | 5039 | ||
| 276 | 부트스트랩 | 7년 전 | 6594 | ||
| 275 | 부트스트랩 | 7년 전 | 4675 | ||
| 274 | 부트스트랩 | 7년 전 | 6708 | ||
| 273 | 부트스트랩 | 7년 전 | 3374 | ||
| 272 | 부트스트랩 | 7년 전 | 3208 | ||
| 271 | 부트스트랩 | 8년 전 | 3708 | ||
| 270 | 부트스트랩 | 8년 전 | 3237 | ||
| 269 | 부트스트랩 | 8년 전 | 3121 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기