0

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>
Giannis
  • 1,790
  • 1
  • 11
  • 29
Emre8
  • 23
  • 3

1 Answers1

0

I don't see you injecting module utils.autofocus in module stockCheckApp. If you are not aware then you can inject it like this:

var app = angular.module('stockCheckApp', ['utils.autofocus']);

I had this issues, https://stackoverflow.com/a/10971756/2008962 should solve your problem.

Arnold Parge
  • 6,684
  • 2
  • 30
  • 34
  • Yes, thank you for the reminder. But "utils.autofocus" was not working anyway. Do you have any idea for a solution with HTML tags? – Emre8 Oct 30 '20 at 19:26