Home > Back-end >  How to break line in text area using $scope angularjs
How to break line in text area using $scope angularjs

Time:10-14

I want to use text area for chat input box, because its resizable, in that I want some prefilled texts to be there, like

HI Jhon,
Thanks for contacting us....

I want to give new line after the text in textarea. My code-

$scope.message = "Hi " $scope.firstName  ",Thanks for contacting us....... ";

I tried, using break tag but that did'nt worked

 <textarea id="typeMessageBox" placeholder="Write here..." type="text submit" ng-model="message"></textarea>

How can I do this ?

CodePudding user response:

Use \n instead of break tag.

eg: $scope.message = "Hi " $scope.firstName ",\n Thanks for contacting us....... ";

  • Related