We are using AngularJS version 1.5.6 and HTML characters are not displayed correctly in text. I've tried many codes but haven't been successful. There are a lot of associated topics in StackOverflow and I've tried most of them, but the HTML code structure still appears.
For example.
2 <sup>3</sup>
Displaying as. In more complex HTML codes, unfortunately, even the text is now difficult to read. How can I get HTML codes decoded?
core.js
app.controller('stockCheckAppController', function ($scope, $http) {
stockCheckAppLoad();
function stockCheckAppLoad() {
$http.get("https://example.com/getSto").success(function (stockCheckAppData) {
$scope.stockCheckAppLoad.innerHTML = stockCheckAppData;
})
}
});
app.js:
var app = angular.module('stockCheckApp', []);
(function () {
'use strict';
angular.module('utils.autofocus', [])
.directive('autofocus', ['$timeout',
function ($timeout) {
return {
restrict: 'A',
link: function ($scope, $element) {
$timeout(function () {
$element[0].focus();
});
}
};
}
]);
})();
index.html
<h3 class="text-white">{{stockCheckAppData.name}}</h3>