如何在textAngular WYSIWYG编辑器中添加新行

时间:2016-08-16 20:10:25

标签: javascript html angularjs textangular

我想在textAngular WYSIWYG编辑器中添加一个新行。

我正在使用\ n,但它不能正常工作

<text-angular ng-model="htmlContent" name="demo-editor" placeholder="sample text \n testttt"></text-angular>

enter image description here

<text-angular ng-model="htmlContent" name="demo-editor" placeholder="sample text <br/> testttt"></text-angular>

enter image description here

1 个答案:

答案 0 :(得分:0)

首先,您必须将此html类添加到您的css

.placeholder-text::before {
  white-space: pre;
}

然后,您可以使用&#39; \ a&#39;。

设置文字
<text-angular ng-model="htmlContent" name="demo-editor" placeholder="sample text \a testttt"></text-angular>

enter image description here