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년 전 | 4492 | ||
| 27 | 반응형웹 | 9년 전 | 7558 | ||
| 26 | 부트스트랩 |
|
10년 전 | 14831 | |
| 25 | 부트스트랩 |
|
10년 전 | 9424 | |
| 24 | 표준화 | 11년 전 | 8296 | ||
| 23 | 반응형웹 | 12년 전 | 13493 | ||
| 22 | 표준화 | 12년 전 | 9467 | ||
| 21 | 표준화 | 12년 전 | 16755 | ||
| 20 | 반응형웹 | 13년 전 | 19691 | ||
| 19 | 반응형웹 | 13년 전 | 31008 | ||
| 18 | 반응형웹 | 13년 전 | 36486 | ||
| 17 | 표준화 | 13년 전 | 12910 | ||
| 16 | 반응형웹 | 13년 전 | 29307 | ||
| 15 | 반응형웹 | 13년 전 | 11841 | ||
| 14 | 반응형웹 | 13년 전 | 31752 | ||
| 13 | 반응형웹 | 13년 전 | 29734 | ||
| 12 | 반응형웹 | 13년 전 | 39242 | ||
| 11 | 반응형웹 | 13년 전 | 50637 | ||
| 10 | 반응형웹 | 13년 전 | 32781 | ||
| 9 | 표준화 | 13년 전 | 9156 | ||
| 8 | 표준화 | 13년 전 | 11230 | ||
| 7 | 표준화 | 13년 전 | 9168 | ||
| 6 | 표준화 | 13년 전 | 11138 | ||
| 5 | 표준화 | 13년 전 | 11241 | ||
| 4 | 표준화 | 13년 전 | 14714 | ||
| 3 | 표준화 | 13년 전 | 8064 | ||
| 2 | 표준화 | 13년 전 | 10173 | ||
| 1 | 표준화 | 13년 전 | 11904 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기