Is it possible to have a newline character in ionicpopup content?
I am trying to do this:
$ionicPopup.alert({
title: 'Now what?',
content: "To start receiving messages: \n"
+ " - Open the side menu (button on top left) \n"
+ " - Tap 'Add Organisations' \n"
+ " - Browse the list of organisations available \n"
+ "or \n"
+ " - Enter a Passphrase to join a private group. \n \n"
+ "Once you've subscribed to an organisation, you'll start receiving messages from them.",
buttons: [
{ text: "Don't show me again" },
{
text: 'Okay',
type: 'button-positive'
}
]
}).then(function(res) {
if(res) {
console.log('You are sure');
} else {
console.log('You are not sure');
}
});
My newline characters are not working. I see the content in the popup as one long paragraph without new lines.
Is this possible?
Yes it is possible to have newline character in ionic popup content.
Replace \n with < br > tag and it works. The ionic framework outputs HTML after execution of that javascript. It also works with html string single quotation string.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With