Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to properly display the info with carriage returns?
Message
Information générale
Forum:
Javascript
Catégorie:
Autre
Divers
Thread ID:
01634462
Message ID:
01634514
Vues:
57
This message has been marked as a message which has helped to the initial question of the thread.
Typically you need to use a filter for this. Add the follwoing to your app configuration code:
        .filter('linebreakFilter', function () {        
            return function(text) {
                if (text)
                    return text.replace(/\n/g, '<br />');
                return text;
            };
        });
Then to use it:
<div ng-bind-html="vm.album.Description | linebreakFilter"></div>
+++ Rick ---



>Hi everybody,
>
>I have the following markup:
>
>
><div class="alert alert-danger" ng-show="alertType === 'serverError'">
>                <button type="button" class="close" ng-click="alertType=''" data-dismiss="!alertType==='serverError'">
>                <span aria-hidden="true">×</span><span class="sr-only">@Labels.close</span></button>
>                <i class="fa fa-exclamation-circle fa-2x"></i>
>                {{ alertMessage }}
>            </div>
>
>I am generating the HttpResponseException with this code
>
>throw new HttpResponseException(
>                    Request.CreateErrorResponse(HttpStatusCode.InternalServerError, response));
>
>
>
>The response string contains carriage returns which are displayed as
>\n\r
>
>on the page instead of the normal breaks. What is the proper way to handle this situation?
>
>Thanks in advance.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform