Angular use marquee tag in ng-html-bind

2k Views Asked by At

I have a information text area and it is represented in marquee right to left. But I also update text every 45 second and i want to restart the motion of marquee

How can i restart the moving of text when the text changed? I use angular ng-html-bind for update the text in every 45 seconds

My controller code is below;

$scope.bind = "<p><font size=\"6\"><marquee>Hello</marquee></font></p>";

Html code;

<div ng-bind-html="bind">
1

There are 1 best solutions below

5
On BEST ANSWER

Instead of trying to bind the html, I would recommend just binding the text.

JSBIN

If you do want to bind new html, you can use $sce to mark the html as safe and remove the escape character \ from your html string:

$scope.myHtml = $sce.trustAsHtml('<p><font size="6"><marquee>Hello</marquee></font></p>');

JSBIN