AngularJS 교차 도메인 포함
AngularJS 교차 도메인 포함
기본적으로 ng-include 지정 문에서는 다른 도메인의 파일을 포함 할 수 없습니다.
다른 도메인의 파일을 포함 시키려면 응용 프로그램의 구성 기능에 법적 파일 및 / 또는 도메인의 화이트리스트를 추가하십시오.
예:
<body ng-app="myApp">
<div ng-include="'https://tryit.w3schools.com/angular_include.php'"></div>
<script>
var app = angular.module('myApp', [])
app.config(function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
'https://tryit.w3schools.com/**'
]);
});
</script>
</body>
[전체소스]
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body ng-app="myApp">
<div ng-include="'https://tryit.w3schools.com/angular_include.php'"></div>
<script>
var app = angular.module('myApp', [])
app.config(function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
'https://tryit.w3schools.com/**'
]);
});
</script>
</body>
</html>
기본적으로 ng-include 지정 문에서는 다른 도메인의 파일을 포함 할 수 없습니다.
다른 도메인의 파일을 포함 시키려면 응용 프로그램의 구성 기능에 법적 파일 및 / 또는 도메인의 화이트리스트를 추가하십시오.
예:
<body ng-app="myApp">
<div ng-include="'https://tryit.w3schools.com/angular_include.php'"></div>
<script>
var app = angular.module('myApp', [])
app.config(function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
'https://tryit.w3schools.com/**'
]);
});
</script>
</body>
[전체소스]
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body ng-app="myApp">
<div ng-include="'https://tryit.w3schools.com/angular_include.php'"></div>
<script>
var app = angular.module('myApp', [])
app.config(function($sceDelegateProvider) {
$sceDelegateProvider.resourceUrlWhitelist([
'https://tryit.w3schools.com/**'
]);
});
</script>
</body>
</html>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 208 | 부트스트랩 | 8년 전 | 2720 | ||
| 207 | AngularJS | 8년 전 | 1461 | ||
| 206 | AngularJS | 8년 전 | 1112 | ||
| 205 | AngularJS | 8년 전 | 984 | ||
| 204 | AngularJS | 8년 전 | 1386 | ||
| 203 | AngularJS | 8년 전 | 1183 | ||
| 202 | AngularJS | 8년 전 | 1499 | ||
| 201 | AngularJS | 8년 전 | 1448 | ||
| 200 | AngularJS | 8년 전 | 1420 | ||
| 199 | AngularJS | 8년 전 | 1345 | ||
| 198 | AngularJS | 8년 전 | 1227 | ||
| 197 | AngularJS | 8년 전 | 1389 | ||
| 196 | AngularJS | 8년 전 | 1043 | ||
| 195 | AngularJS | 8년 전 | 1253 | ||
| 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년 전 | 1395 | ||
| 187 | AngularJS | 8년 전 | 1367 | ||
| 186 | AngularJS | 8년 전 | 1399 | ||
| 185 | AngularJS | 8년 전 | 1433 | ||
| 184 | AngularJS | 8년 전 | 1477 | ||
| 183 | AngularJS | 8년 전 | 1469 | ||
| 182 | AngularJS | 8년 전 | 1008 | ||
| 181 | AngularJS | 8년 전 | 1386 | ||
| 180 | AngularJS | 8년 전 | 1277 | ||
| 179 | AngularJS | 8년 전 | 1249 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기