Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
There is a need to fetch data from a REST API on selection of filter on the Analysis sheet. For that I am trying to write a simple REST call through Angular extension but its not retrieving any data from the resource. Below is the js file.
define( ["qlik", "text!./template.html", "angular"],
function ( qlik, template, angular ) {
return {
template: template,
support: {
snapshot: true,
export: true,
exportData: false
},
paint: function () {
return qlik.Promise.resolve();
},
controller: ['$scope','$http', function ( $scope, $http) {
//add your rendering code here
$http.get("https://www.w3schools.com/angular/welcome.htm")
.then(function(response) {
$scope.html = response.data;
});
// $scope.html = "Hello World";
//$scope.html = angular.version ;
}]
};
} );
and the template. html is as below:
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.2/angular.min.js"></script>
<div qv-extension style="height: 100%; position: relative; overflow: auto;" class="ng-scope">
{{ html }}
</div>
Appreciate any suggestion here.
the issue was with the CORS policy with https://www.w3schools.com/angular/welcome.htm. It works fine with other REST end points.
Also there is no need to add angular.min in the template.html
the issue was with the CORS policy with https://www.w3schools.com/angular/welcome.htm. It works fine with other REST end points.
Also there is no need to add angular.min in the template.html