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>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 28 | 반응형웹 | 9년 전 | 4495 | ||
| 27 | 반응형웹 | 9년 전 | 7563 | ||
| 26 | 부트스트랩 |
|
10년 전 | 14833 | |
| 25 | 부트스트랩 |
|
10년 전 | 9426 | |
| 24 | 표준화 | 11년 전 | 8297 | ||
| 23 | 반응형웹 | 12년 전 | 13496 | ||
| 22 | 표준화 | 12년 전 | 9470 | ||
| 21 | 표준화 | 12년 전 | 16758 | ||
| 20 | 반응형웹 | 13년 전 | 19691 | ||
| 19 | 반응형웹 | 13년 전 | 31016 | ||
| 18 | 반응형웹 | 13년 전 | 36492 | ||
| 17 | 표준화 | 13년 전 | 12912 | ||
| 16 | 반응형웹 | 13년 전 | 29311 | ||
| 15 | 반응형웹 | 13년 전 | 11844 | ||
| 14 | 반응형웹 | 13년 전 | 31758 | ||
| 13 | 반응형웹 | 13년 전 | 29738 | ||
| 12 | 반응형웹 | 13년 전 | 39246 | ||
| 11 | 반응형웹 | 13년 전 | 50643 | ||
| 10 | 반응형웹 | 13년 전 | 32789 | ||
| 9 | 표준화 | 13년 전 | 9159 | ||
| 8 | 표준화 | 13년 전 | 11237 | ||
| 7 | 표준화 | 13년 전 | 9175 | ||
| 6 | 표준화 | 13년 전 | 11144 | ||
| 5 | 표준화 | 13년 전 | 11244 | ||
| 4 | 표준화 | 13년 전 | 14722 | ||
| 3 | 표준화 | 13년 전 | 8073 | ||
| 2 | 표준화 | 13년 전 | 10176 | ||
| 1 | 표준화 | 13년 전 | 11910 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기