I am using AngularJS 1 to load a .json file with the sources of the iframes I am using (see my controller below):
myApp.controller('iFrames', ['$scope', '$http', function($scope, $http){
console.log("ENTERING LOADING IFRAME");
$http.post('../json/iframes.json').success(function(data){
console.log("LOADING SUCCESSFULL");
$scope.iframes = data;
});
console.log("LEAVING LOADING IFRAME");
}]);
The problem is that the iframes are not showing at all on my page, knowing that the json file is loaded correctly.
You need to know that the urls in the json file are all in https, I think that this is what is causing the problem here.
In the html I have:
<div class="col-lg-4 col-md-4 col-sm-6 col-xs-6" ng-controller="iFrames">
<div class="panel">
<div class="panel-body">
<h3 class="text-center" style="color:white"><div id="changeStat"><span data-i18n="mainTranslation.user.house.consommation"></span></div></h3>
<div id="statRealTime" ng-repeat="iframe in iframes" >
<iframe ng-src="{{(iframe.src)}}" width="420" height="75" frameborder="0"></iframe>
</div>
<div id="statHistory" style="display: none" ng-repeat="iframe in iframes" >
<iframe ng-src="{{(iframe.srcHist)}}" width="420" height="75" frameborder="0"></iframe>
</div>
</div>
</div>
</div>
I am getting an error is that the url is somehow insecure.
"Error: [$interpolate:interr] http://errors.angularjs.org/1.5.0/$interpolate/interr?p0=%7B%7B(iframe.srcHist)%7D%7D&p1=Error%3A%20%5B%24sce%3Ainsecurl%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.5.0%2F%24sce%2Finsecurl%3Fp0%3Dhttps%253A%252F%252F.......
My file is in local, i also tried to put it on a distant server but still the same issue.
I would appreciate some help...