for example:
function foo() located in my controller:
$scope.getOffers = function(){
var txt1="aaaa"+"<br>"+"bbbb";
$scope.newData = txt1;
};
and my html:
<div class="help-block" ng-show="newData ">{{ offers }}</div>
and when I called foo() the text that showed up was:
aaaa<br>bbbb
instead of :
aaaa
bbbb
(I already tried to insert \n in my text...)
What am I missing? and how can I fix the problem?
thanks!
.trustAsHtml()orng-bind-htmlto help with this, but if you are trying to structure your variables to hold HTML in the first place, you are probably not fully embracing the angular paradigm.