0
인 ionic1보기에서 http.get 요청의 변수에 캡처 된 HTML 표시 ionint보기에서 각도가있는 HTTP 요청으로 캡처 된 HTML 페이지를 tryintg 할 때 문제가 있습니다.각도가
내 컨트롤러 코드 :
app.controller('MiNegocioCtrl', function ($scope, ajax, $sce) {
ajax.sendApiRequest({}, "GET", url, true).then(function (response) {
$scope.data = response.data;
console.log(response.data);
var negocio = angular.element("#negocio");
negocio.html(response.data);
}, function (error) {
_showPopUp('error', 'error');
});
})
내보기 코드 :
// In your controller, inject the $sce service, and mark the HTML as "trusted":
.controller('MiNegocioCtrl', function($scope, $http, $sce) {
$scope.data = "";
// make request with service $http
$http.get(url).then(function (response) {
$scope.data = $sce.trustAsHtml(response.data);
});
})
로보기 :
<ion-view title="Negocio" id="page10">
<ion-content>
<div id="negocio" style="width: 100%;height: 100%"></div>
</ion-content>
</ion-view>
감사합니다.하지만 같은 오류가 있습니다 !!! 나는 그 코드를 테스트하고 있었다 !! @Andrei –
Cannor 읽기 속성 'classList'of null @Andrei –