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>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 178 | AngularJS | 8년 전 | 1429 | ||
| 177 | AngularJS | 8년 전 | 1202 | ||
| 176 | AngularJS | 8년 전 | 1275 | ||
| 175 | AngularJS | 8년 전 | 1365 | ||
| 174 | AngularJS | 8년 전 | 1140 | ||
| 173 | AngularJS | 8년 전 | 1882 | ||
| 172 | AngularJS | 8년 전 | 1437 | ||
| 171 | AngularJS | 8년 전 | 1129 | ||
| 170 | AngularJS | 8년 전 | 1394 | ||
| 169 | AngularJS | 8년 전 | 1190 | ||
| 168 | AngularJS | 8년 전 | 1002 | ||
| 167 | AngularJS | 8년 전 | 1966 | ||
| 166 | AngularJS | 8년 전 | 1040 | ||
| 165 | AngularJS | 8년 전 | 1105 | ||
| 164 | AngularJS | 8년 전 | 1310 | ||
| 163 | AngularJS | 8년 전 | 1153 | ||
| 162 | AngularJS | 8년 전 | 1368 | ||
| 161 | AngularJS | 8년 전 | 1371 | ||
| 160 | AngularJS | 8년 전 | 1126 | ||
| 159 | AngularJS | 8년 전 | 1093 | ||
| 158 | AngularJS | 8년 전 | 1507 | ||
| 157 | AngularJS | 8년 전 | 1479 | ||
| 156 | AngularJS | 8년 전 | 1325 | ||
| 155 | AngularJS | 8년 전 | 1214 | ||
| 154 | AngularJS | 8년 전 | 1614 | ||
| 153 | AngularJS | 8년 전 | 1095 | ||
| 152 | AngularJS | 8년 전 | 1529 | ||
| 151 | AngularJS | 8년 전 | 1420 | ||
| 150 | AngularJS | 8년 전 | 1117 | ||
| 149 | AngularJS | 8년 전 | 1643 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기