Created
July 3, 2020 02:43
-
-
Save vipul-zambare006/90f4c97366d48ecd85c834d4d8dd30f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ANGULAR LEARNING: | |
ANGULAR NOTES | |
1. app.module.ts: This is entry point | |
2. app.component.ts: It has backend typescript code | |
3. learn about pipes | use: data formatting | |
4. variable declaration: name:string = “Brad” | |
5. function declaration: changeName(name:string):void => note param type and method return type | |
6. Why SERVICES? A component can delegate certain tasks to services, such as | |
1. fetching data from the server | |
2. validating user input | |
3. logging directly to the console. | |
7. SERVICES injected to COMPONENTS | |
8. Services : @Injectable() | |
9. Providing services | |
You must register at least one provider of any service you are going to use. The provider can be part of the service's own metadata, making that service available everywhere, or you can register providers with specific modules or components. You register providers in the metadata of the service (in the @Injectable() decorator), or in the @NgModule() or @Component()metadata | |
10. binding event to method: | |
<button (click)="deleteHero()">Delete hero</button> | |
In angular components are also directives | |
*ngIf: why star is used? | |
coz its strctural directive which directly changes the dom. | |
*ngIf isOpen; else #templateId | |
<ng-template #templateId> </ng-template> | |
ngStyle Directive : To add conditional CSS | |
ANGULAR Transclusion | |
Angular projection | |
ANGULAR 2 COMPILER: https://www.youtube.com/watch?v=kW9cJsvcsGo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment