From 9741f5b8cf8bd0d8909b52dbd4409dd07f612f0c Mon Sep 17 00:00:00 2001 From: Judy Bogart Date: Fri, 2 Nov 2018 08:52:36 -0700 Subject: [PATCH] docs: new doc for core directives (#26923) PR Close #26923 --- packages/core/src/metadata/directives.ts | 149 ++++++++++------------- 1 file changed, 66 insertions(+), 83 deletions(-) diff --git a/packages/core/src/metadata/directives.ts b/packages/core/src/metadata/directives.ts index 45e9fe2669..441eea8b37 100644 --- a/packages/core/src/metadata/directives.ts +++ b/packages/core/src/metadata/directives.ts @@ -136,6 +136,7 @@ export interface Directive { * id: string; * * ``` + * */ inputs?: string[]; @@ -170,6 +171,7 @@ export interface Directive { * class MainComponent { * } * ``` + * */ outputs?: string[]; @@ -201,6 +203,7 @@ export interface Directive { * class MainComponent { * } * ``` + * */ exportAs?: string; @@ -436,6 +439,67 @@ export interface ComponentDecorator { * * ``` * + * ### Preserving whitespace + * + * Removing whitespace can greatly reduce AOT-generated code size and speed up view creation. + * As of Angular 6, the default for `preserveWhitespaces` is false (whitespace is removed). + * To change the default setting for all components in your application, set + * the `preserveWhitespaces` option of the AOT compiler. + * + * By default, the AOT compiler removes whitespace characters as follows: + * * Trims all whitespaces at the beginning and the end of a template. + * * Removes whitespace-only text nodes. For example, + * + * ``` + * + * ``` + * + * becomes: + * + * ``` + * + * ``` + * + * * Replaces a series of whitespace characters in text nodes with a single space. + * For example, `\n some text\n` becomes ` some text `. + * * Does NOT alter text nodes inside HTML tags such as `
` or `