5 lines
24 KiB
JSON
5 lines
24 KiB
JSON
|
{
|
||
|
"id": "guide/cheatsheet",
|
||
|
"title": "Cheat Sheet",
|
||
|
"contents": "\n\n\n<div class=\"github-links\">\n <a href=\"https://github.com/angular/angular/edit/master/aio/content/guide/cheatsheet.md?message=docs%3A%20describe%20your%20change...\" aria-label=\"Suggest Edits\" title=\"Suggest Edits\"><i class=\"material-icons\" aria-hidden=\"true\" role=\"img\">mode_edit</i></a>\n</div>\n\n\n<div class=\"content\">\n <div class=\"center-layout-wide\">\n<h1 class=\"no-toc\" id=\"cheat-sheet\">Cheat Sheet<a title=\"Link to this heading\" class=\"header-link\" aria-hidden=\"true\" href=\"guide/cheatsheet#cheat-sheet\"><i class=\"material-icons\">link</i></a></h1>\n<table class=\"is-full-width is-fixed-layout\">\n<tbody><tr>\n<th>Bootstrapping</th>\n<th><p><code>import { <a href=\"api/platform-browser-dynamic/platformBrowserDynamic\" class=\"code-anchor\">platformBrowserDynamic</a> } from '@angular/platform-browser-dynamic';</code>\n</p>\n</th>\n</tr>\n<tr>\n<td><code><b><a href=\"api/platform-browser-dynamic/platformBrowserDynamic\" class=\"code-anchor\">platformBrowserDynamic</a>().bootstrapModule</b>(AppModule);</code></td>\n<td><p>Bootstraps the app, using the root component from the specified <code><a href=\"api/core/NgModule\" class=\"code-anchor\">NgModule</a></code>. </p>\n</td>\n</tr>\n</tbody></table>\n<table class=\"is-full-width is-fixed-layout\">\n<tbody><tr>\n<th>NgModules</th>\n<th><p><code>import { <a href=\"api/core/NgModule\" class=\"code-anchor\">NgModule</a> } from '@angular/core';</code>\n</p>\n</th>\n</tr>\n<tr>\n<td><code>@<b><a href=\"api/core/NgModule\" class=\"code-anchor\">NgModule</a></b>({\n declarations: ..., imports: ..., exports: ...,\n providers: ..., bootstrap: ...\n})\nclass MyModule {}\n</code></td>\n<td><p>Defines a module that contains components, directives, pipes, and providers.</p>\n</td>\n</tr><tr>\n<td><code><b>declarations:</b> [MyRedComponent, MyBlueComponent, MyDatePipe]</code></td>\n<td><p>List of components, directives, and pipes that belong to this module.</p>\n</td>\n</tr><tr>\n<td><code><b>imports:</b> [<a href=\"api/platform-browser/BrowserModule\" class=\"code-anchor\">BrowserModule</a>, SomeOtherModule]</code></td>\n<td><p>List of modules to import into this module. Everything from the imported modules\nis available to <code>declarations</code> of this module.</p>\n</td>\n</tr><tr>\n<td><code><b>exports:</b> [MyRedComponent, MyDatePipe]</code></td>\n<td><p>List of components, directives, and pipes visible to modules that import this module.</p>\n</td>\n</tr><tr>\n<td><code><b>providers:</b> [MyService, { provide: ... }]</code></td>\n<td><p>List of dependency injection providers visible both to the contents of this module and to importers of this module.</p>\n</td>\n</tr><tr>\n<td><code><b>entryComponents:</b> [SomeComponent, OtherComponent]</code></td>\n<td><p>List of components not referenced in any reachable template, for example dynamically created from code.</p></td>\n</tr><tr>\n<td><code><b>bootstrap:</b> [MyAppComponent]</code></td>\n<td><p>List of components to bootstrap when this module is bootstrapped.</p>\n</td>\n</tr>\n</tbody></table>\n<table class=\"is-full-width is-fixed-layout\">\n<tbody><tr>\n<th>Template syntax</th>\n<th></th>\n</tr>\n<tr>\n<td><code><input <b>[value]</b>=\"firstName\"></code></td>\n<td><p>Binds property <code>value</code> to the result of expression <code>firstName</code>.</p>\n</td>\n</tr><tr>\n<td><code><div <b>[attr.role]</b>=\"myAriaRole\"></code></td>\n<td><p>Binds attribute <code>role</code> to the result of expression <code>myAriaRole</code>.</p>\n</td>\n</tr><tr>\n<td><code><div <b>[class.extra-sparkle]</b>=\"isDelightful\"></code></td>\n<td><p>Binds the presence of the CSS class <code>extra-sparkle</code> on the element to the truthiness of the expression <code>isDelightful</code>.</p>\n</td>\n</tr><tr>\n<td><code><div <b>[style.width.px]</b>=\"mySize\"></code></td>\n<td><p>Binds style property <code>width</code> to the result of expression <code>mySize</code> in pixels. Units are optional.</p>\n</td>\n</tr><tr>\n<td><code><button <b>(click)</b>=\"readRainbo
|
||
|
}
|