angular_docs_getting_started
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| angular_docs_getting_started [2023/10/04 10:17] – [Angular applications: The essentials] kalaschnikow | angular_docs_getting_started [2023/10/04 11:12] (current) – kalaschnikow | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Angular Docs Getting Started ====== | ||
| + | ===== What is Angular? ===== | ||
| + | |||
| + | https:// | ||
| + | |||
| + | Angular is a development platform based on TypeScript. It includes: | ||
| + | * component-based framework | ||
| + | * libraries, which covers a variety of features like routing, forms management etc. | ||
| + | * developer tools | ||
| + | |||
| + | ==== Angular applications: | ||
| + | |||
| + | === Components === | ||
| + | |||
| + | A Component includes a TypeScript class with: | ||
| + | * @Component() decorator | ||
| + | * HTML-template | ||
| + | * styles | ||
| + | |||
| + | |||
| + | === Templates === | ||
| + | |||
| + | The HTML template declares how the component should be rendered. It can be done inline or by file path. | ||
| + | |||
| + | Inline: | ||
| + | < | ||
| + | @Component ({ | ||
| + | selector: ' | ||
| + | template: `< | ||
| + | }) | ||
| + | </ | ||
| + | |||
| + | By file path: | ||
| + | < | ||
| + | @Component ({ | ||
| + | selector: ' | ||
| + | templateUrl: | ||
| + | }) | ||
| + | </ | ||
| + | |||
| + | |||
| + | * Double curly braces ( '' | ||
| + | * indicate that the value should be interpolated | ||
| + | |||
| + | |||
| + | * Property binding ( '' | ||
| + | * sets values for properties and attribute of HTML elements | ||
| + | |||
| + | The following examples illustrates how the HTML attribute '' | ||
| + | < | ||
| + | <p | ||
| + | [id]=" | ||
| + | [style.color]=" | ||
| + | You can set my color in the component! | ||
| + | </p> | ||
| + | </ | ||
| + | |||
| + | **Event listeners** can be declared with the help of parentheses: | ||
| + | < | ||
| + | <button | ||
| + | type=" | ||
| + | [disabled]=" | ||
| + | (click)=" | ||
| + | Trigger alert message | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | The event listener calls the method '' | ||
| + | |||
| + | |||
| + | **Directives** can be used to add features to the templates. For example: | ||
| + | * *ngIf | ||
| + | * *ngFor | ||
| + | It is also possible to declare own custom directives. | ||
| + | |||
| + | === Dependency Injection === | ||
| + | |||
| + | * in the class which should be injected | ||
| + | * '' | ||
| + | * in the class which uses the injected functionality | ||
| + | * import | ||
| + | * e.g. '' | ||
| + | * variable which uses the injected class | ||
| + | * e.g. | ||
| + | * declaration: | ||
| + | * '' | ||
| + | * and then using: | ||
| + | * '' | ||
| + | |||
| + | |||
| + | ==== Angular CLI ==== | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | |||
| + | ==== First-party libraries ==== | ||
| + | * Angular Router -> Advanced client-side navigation and routing based on Angular components. Supports lazy-loading, | ||
| + | * Angular Forms -> Uniform system for form participation and validation. | ||
| + | * Angular HttpClient -> Robust HTTP client that can power more advanced client-server communication. | ||
| + | * Angular Animations -> Rich system for driving animations based on application state. | ||
| + | * Angular PWA -> Tools for building Progressive Web Applications (PWA) including a service worker and Web application manifest. | ||
| + | * Angular Schematics -> Automated scaffolding, | ||
| + | |||
| + | ===== Try it ===== | ||
| + | * Getting started | ||
| + | * ... | ||
| + | * Adding navigation | ||
| + | * ... | ||
| + | * Managing data | ||
| + | * ... | ||
| + | * Using forms for user input | ||
| + | * ... | ||
| + | * Deploying an application | ||
| + | * ... | ||
| + | |||
| + | ===== Setup ===== | ||
| + | ... | ||
