CommonModule
Exports all the basic Angular directives and pipes,
such as NgIf
, NgForOf
, DecimalPipe
, and so on.
Re-exported by BrowserModule
, which is included automatically in the root
AppModule
when you create a new app with the CLI new
command.
class CommonModule {
}
Description
- The
providers
options configure the NgModule's injector to provide localization dependencies to members. - The
exports
options make the declared directives and pipes available for import by other NgModules.
Providers
Provider |
---|
|
Directives
Name | Description |
---|---|
|
Adds and removes CSS classes on an HTML element. |
|
Instantiates a single |
|
A structural directive that renders a template for each item in a collection. The directive is placed on an element, which becomes the parent of the cloned templates. |
|
A structural directive that conditionally includes a template based on the value of
an expression coerced to Boolean.
When the expression evaluates to true, Angular renders the template
provided in a |
|
Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization. |
|
Creates a view that will be added/removed from the parent |
|
An attribute directive that updates styles for the containing HTML element.
Sets one or more style properties, specified as colon-separated key-value pairs.
The key is a style name, with an optional |
|
A structural directive that adds or removes templates (displaying or hiding views) when the next match expression matches the switch expression. |
|
Provides a switch case expression to match against an enclosing |
|
Creates a view that is rendered when no |
|
Inserts an embedded view from a prepared |
Pipes
Name | Description |
---|---|
|
Unwraps a value from an asynchronous primitive. |
|
Transforms a number to a currency string, formatted according to locale rules that determine group sizing and separator, decimal-point character, and other locale-specific configurations. |
|
Formats a date value according to locale rules. |
|
Transforms a number into a string, formatted according to locale rules that determine group sizing and separator, decimal-point character, and other locale-specific configurations. |
|
Formats a number as currency using locale rules. |
|
Formats a date according to locale rules. |
|
Formats a number as text. Group sizing and separator and other locale-specific configurations are based on the active locale. |
|
Formats a number as percentage according to locale rules. |
|
Maps a value to a string that pluralizes the value according to locale rules. |
|
Generic selector that displays the string that matches the current value. |
|
Converts a value into its JSON-format representation. Useful for debugging. |
|
Transforms Object or Map into an array of key value pairs. |
|
Transforms text to all lower case. |
|
Transforms a number to a percentage string, formatted according to locale rules that determine group sizing and separator, decimal-point character, and other locale-specific configurations. |
|
Creates a new |
|
Transforms text to title case. Capitalizes the first letter of each word, and transforms the rest of the word to lower case. Words are delimited by any whitespace character, such as a space, tab, or line-feed character. |
|
Transforms text to all upper case. |