top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to preserve whitespace in Angular?

0 votes
462 views
How to preserve whitespace in Angular?
posted Apr 24, 2018 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

In Angular using preserveWhitespaces flag we can perserving whitespaces. We can use this in 2 places. either main.ts nor tsconfig.json

main.ts

platformBrowserDynamic().bootstrapModule(AppModule, { preserveWhitespaces: false });

tsconfig.json

{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/app",
    "baseUrl": "./",
    "module": "es2015",
    "types": []
  },
  "exclude": [
    "test.ts",
    "**/*.spec.ts"
  ],
  "angularCompilerOptions": {
    "preserveWhitespaces": false
  }
}
answer Apr 25, 2018 by Kuldeep Apte
Similar Questions
0 votes

I need to reuse my Javascript module in typescript for my angular application. Can you guide me how to do that ?

...