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>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 268 | 부트스트랩 | 7년 전 | 3126 | ||
| 267 | 부트스트랩 | 7년 전 | 2917 | ||
| 266 | 부트스트랩 | 7년 전 | 2903 | ||
| 265 | 부트스트랩 | 7년 전 | 3400 | ||
| 264 | 부트스트랩 | 7년 전 | 3142 | ||
| 263 | 부트스트랩 | 7년 전 | 3212 | ||
| 262 | 부트스트랩 | 8년 전 | 2716 | ||
| 261 | 부트스트랩 | 8년 전 | 4833 | ||
| 260 | 부트스트랩 | 8년 전 | 3209 | ||
| 259 | 부트스트랩 | 8년 전 | 2753 | ||
| 258 | 부트스트랩 | 8년 전 | 2778 | ||
| 257 | 부트스트랩 | 8년 전 | 2801 | ||
| 256 | 부트스트랩 | 8년 전 | 3294 | ||
| 255 | 부트스트랩 | 8년 전 | 3484 | ||
| 254 | 부트스트랩 | 8년 전 | 3222 | ||
| 253 | 부트스트랩 | 8년 전 | 4098 | ||
| 252 | 부트스트랩 | 8년 전 | 2880 | ||
| 251 | 부트스트랩 | 8년 전 | 2604 | ||
| 250 | 부트스트랩 | 8년 전 | 2711 | ||
| 249 | 부트스트랩 | 8년 전 | 2417 | ||
| 248 | 부트스트랩 | 8년 전 | 1965 | ||
| 247 | 부트스트랩 | 8년 전 | 1724 | ||
| 246 | 부트스트랩 | 8년 전 | 1996 | ||
| 245 | 부트스트랩 | 8년 전 | 1518 | ||
| 244 | 부트스트랩 | 8년 전 | 2131 | ||
| 243 | 부트스트랩 | 8년 전 | 1885 | ||
| 242 | 부트스트랩 | 8년 전 | 1772 | ||
| 241 | 부트스트랩 | 8년 전 | 1158 | ||
| 240 | 부트스트랩 | 8년 전 | 1613 | ||
| 239 | 부트스트랩 | 8년 전 | 1645 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기