- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2017 12:54 AM
Hi Everyone,
I have created a widget for variable for service portal.
Can anyone tell how to apply break or next line for the below code
XYZ: string should come in second line. How to apply a break tag for this. Please help.
Thanks
Johny
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2017 03:02 AM
Have you changed the HTML template as i directed?
You need to have a tag something like the below. The "ng-bind-html" is what causes it to render the <br/> tag as HTML rather than text
<h3 ng-bind-html="c.title"></h3>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2017 01:57 AM
You'll probably want to use a standard html line break: <br/>. However the issue is that this will be encoded and displayed literally on the page which you don't want:
So you also have to use a special directive in the HTML, like so:
Widget HTML Template:
<h3 ng-bind-html="c.title"></h3>
Client Script:
function($scope) {
/* widget controller */
var c = this;
c.title = 'foo <br/> bar';
}
Result:
See the docs. Here is a example.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2017 02:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2017 03:02 AM
Have you changed the HTML template as i directed?
You need to have a tag something like the below. The "ng-bind-html" is what causes it to render the <br/> tag as HTML rather than text
<h3 ng-bind-html="c.title"></h3>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2017 03:26 AM
Thanks a lot Andrew. It worked