I am loading a bunch of data from a json file, and have used both $http.get
and also Restangular to grab it.
Whenever I pass this data into the $scope
I keep getting this error multiple times:
Error: [$sce:itype] Attempted to trust a non-string value in a content requiring a string: Context: html
This seems to fire multiple times for each item in the array, so unsure if the data itself is bad somehow?
The problem only happens if I pass it to $scope
, and according to Can we use $sce.trustAsHtml(string) out of "filter"s? its happening when you call trustAsHtml
on something twice, which I am not. Infact I'm not even calling this once, so can only assume thats happening somewhere when I pass it to $scope
$http.get('/airlines.json')
.success(function(data) {
$scope.airlines = data;
console.log(data);
});
I can't find much else about about this error thats helpful. The data is below:
[
{
"id":1,
"name":"Private flight",
"alias":"\\N",
"iata":"-",
"icao":"N/A",
"callsign":"",
"country":"",
"active":"Y"
},
{
"id":2,
"name":"135 Airways",
"alias":"\\N",
"iata":"",
"icao":"GNL",
"callsign":"GENERAL",
"country":"United States",
"active":"N"
},
{
"id":3,
"name":"1Time Airline",
"alias":"\\N",
"iata":"1T",
"icao":"RNX",
"callsign":"NEXTIME",
"country":"South Africa",
"active":"Y"
}
]
Question: Why is this error coming up when I pass it to the scope, and how can I get rid of it?