Answer the question
In order to leave comments, you need to log in
How to overcome escaping of & character in Angular.js?
I need to display text containing a non-breaking space: $scope.myfield = 'A B';
Since & is inserted into the template, & , then instead of a non-breaking space, I see
I tried several options: codepen.io/anon/pen/yvJlc
But none of them gave the desired result.
At the same time, if you try to enter A B in the demo at angular.ru/api/ngSanitize.$sanitize , then everything is displayed there as I need.
I don't understand what's wrong.
Answer the question
In order to leave comments, you need to log in
No trick.
Angular "does not trust" you. Therefore, Sanitize & SCE must be used.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question