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>
게시판 목록
퍼블리싱강좌
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 148 | AngularJS | 8년 전 | 1655 | ||
| 147 | AngularJS | 8년 전 | 1074 | ||
| 146 | AngularJS | 8년 전 | 1260 | ||
| 145 | AngularJS | 8년 전 | 1370 | ||
| 144 | AngularJS | 8년 전 | 1156 | ||
| 143 | AngularJS | 8년 전 | 1201 | ||
| 142 | AngularJS | 8년 전 | 1172 | ||
| 141 | AngularJS | 8년 전 | 1335 | ||
| 140 | AngularJS | 8년 전 | 1197 | ||
| 139 | AngularJS | 8년 전 | 1442 | ||
| 138 | AngularJS | 8년 전 | 1152 | ||
| 137 | AngularJS | 8년 전 | 1063 | ||
| 136 | AngularJS | 8년 전 | 1152 | ||
| 135 | AngularJS | 8년 전 | 1679 | ||
| 134 | AngularJS | 8년 전 | 1380 | ||
| 133 | AngularJS | 8년 전 | 1476 | ||
| 132 | AngularJS | 8년 전 | 1098 | ||
| 131 | AngularJS | 8년 전 | 1370 | ||
| 130 | AngularJS | 8년 전 | 1465 | ||
| 129 | AngularJS | 8년 전 | 1444 | ||
| 128 | AngularJS | 8년 전 | 2061 | ||
| 127 | AngularJS | 8년 전 | 1485 | ||
| 126 | jQuery Mobile | 8년 전 | 2259 | ||
| 125 | jQuery Mobile | 8년 전 | 2015 | ||
| 124 | jQuery Mobile | 8년 전 | 1882 | ||
| 123 | jQuery Mobile | 8년 전 | 1814 | ||
| 122 | jQuery Mobile | 8년 전 | 1855 | ||
| 121 | jQuery Mobile | 8년 전 | 2059 | ||
| 120 | jQuery Mobile | 8년 전 | 1594 | ||
| 119 | jQuery Mobile | 8년 전 | 1678 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기