I am sure this has been asked before, but I cannot find the answer.
I have an AngularJS script that pulls from a database and then outputs to the content. Everything works correctly, except for a few places that I am trying to combine several words with new lines between them.
**in the script.js** groupedList[aIndex].CATEGORY = existingCategory+'\n'+thisCategory; groupedList[aIndex].CATEGORY = existingCategory+'<br>'+thisCategory;
If I use the first line of the above code, I canβt see anything, but there is no new line in the redered html. If I use the second line, <br> obtained as text, and the result is as follows:
Instinct<br>Media
instead
Instinct Media
I can publish the full script if it were useful, but I assume that there is something simple that I just don't see.
UPDATE Here is the full js
function qCtrl($scope, $filter, $http, $timeout){ $scope.getCategories = function(){$http.post('quote.cfc?method=getCategories').success(function(data) { $scope.categories = data; }); } $scope.getClassifications = function(){$http.post('quote.cfc?method=getClassifications').success(function(data) { $scope.classifications = data; }); } $scope.getIndustries = function(){$http.post('quote.cfc?method=getIndustries').success(function(data) { $scope.industries = data; }); } $scope.getKeywords = function(){$http.post('quote.cfc?method=getKeywords').success(function(data) { $scope.keywords = data; }); } $scope.getSources = function(){$http.post('quote.cfc?method=getSources').success(function(data) { $scope.sources = data; }); } $scope.getAllQuotes = function(){$http.post('quote.cfc?method=getAllQuotesJoined').success(function(data) { $scope.allQuotes = data; }); } $scope.initScopes = function (){ $scope.getCategories(); $scope.getClassifications(); $scope.getIndustries(); $scope.getKeywords(); $scope.getSources(); $scope.getAllQuotes(); } $scope.initScopes();
Here is the HTML
<div ng-repeat="q in filteredQuotes" class="well clearfix"> <h3>{{q.TITLE}}</h3> <div class="row-fluid" style="margin-bottom:5px;"> <div class="span3 well-small whBG"><h4>Classification</h4>{{q.CLASSIFICATION}}</div> <div class="span3 well-small whBG pipeHolder"><h4>Categories</h4>{{q.CATEGORY}}</div> <div class="span3 well-small whBG"><h4>Key Words</h4>{{q.KEYWORD}}</div> <div class="span3 well-small whBG"><h4>Additional</h4>Industry = {{q.INDUSTRY}}<br>Source = {{q.SOURCE}}</div> </div> <div class="well whBG">{{q.TESTQUOTE}}</div> <div class="tiny"> Source comment : {{q.SOURCECOMMENT}}<br> Additional Comment : {{q.COMMENT}} </div> </div> </div>
javascript angularjs
Lance Feb 19 '13 at 17:14 2013-02-19 17:14
source share