I want to print out some dynamic text to my div called sqlOutput. I want it to be formatted with newline characters. I've tried (obviously <br> and /\r\n). But it didn't work.
How can I have a well formatted text using Angular?
$scope.buildScripts = function () {
var mainTable = "DROP TABLE [dbo].[" + $scope.tableName + "] <br>"
+ "GO <br>"
+ "SET ANSI_NULLS ON <br>"
+ "GO <br>"
+ "SET QUOTED_IDENTIFIER ON <br>"
+ "GO <br>"
+ "SET ANSI_PADDING ON <br>"
+ "GO <br>"
+ "CREATE TABLE [dbo].[" + $scope.tableName + "](";
$scope.sqlOutput = mainTable;
}
<pre>tag since newlines are preserved. There is no reason to use\r\n.