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년 전 | 1434 | ||
| 177 | AngularJS | 8년 전 | 1206 | ||
| 176 | AngularJS | 8년 전 | 1275 | ||
| 175 | AngularJS | 8년 전 | 1371 | ||
| 174 | AngularJS | 8년 전 | 1143 | ||
| 173 | AngularJS | 8년 전 | 1885 | ||
| 172 | AngularJS | 8년 전 | 1440 | ||
| 171 | AngularJS | 8년 전 | 1131 | ||
| 170 | AngularJS | 8년 전 | 1395 | ||
| 169 | AngularJS | 8년 전 | 1191 | ||
| 168 | AngularJS | 8년 전 | 1005 | ||
| 167 | AngularJS | 8년 전 | 1970 | ||
| 166 | AngularJS | 8년 전 | 1042 | ||
| 165 | AngularJS | 8년 전 | 1110 | ||
| 164 | AngularJS | 8년 전 | 1312 | ||
| 163 | AngularJS | 8년 전 | 1157 | ||
| 162 | AngularJS | 8년 전 | 1372 | ||
| 161 | AngularJS | 8년 전 | 1380 | ||
| 160 | AngularJS | 8년 전 | 1134 | ||
| 159 | AngularJS | 8년 전 | 1096 | ||
| 158 | AngularJS | 8년 전 | 1514 | ||
| 157 | AngularJS | 8년 전 | 1482 | ||
| 156 | AngularJS | 8년 전 | 1327 | ||
| 155 | AngularJS | 8년 전 | 1215 | ||
| 154 | AngularJS | 8년 전 | 1623 | ||
| 153 | AngularJS | 8년 전 | 1112 | ||
| 152 | AngularJS | 8년 전 | 1533 | ||
| 151 | AngularJS | 8년 전 | 1425 | ||
| 150 | AngularJS | 8년 전 | 1125 | ||
| 149 | AngularJS | 8년 전 | 1647 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기