Last active
March 13, 2022 02:11
-
-
Save silversonicaxel/5b4733009a44be0c39402fe20e3e8e00 to your computer and use it in GitHub Desktop.
ANGULAR #angular
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
// to install angular cli | |
$ sudo npm install -g @angular/cli | |
// to create a new angular project | |
$ ng new angular-project | |
$ cd [TEST-PROJECT] | |
// to launch the application | |
$ ng serve | |
// to generate components | |
$ ng generate component [TEST-COMPONENT] | |
// to generate service | |
$ ng generate service [TEST-SERVICE] | |
$ ng generate service [TEST-SERVICE] --module=app | |
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
@Component is a component decorator that specifies three metadata | |
-selector | |
-tempalteUrl | |
-styleUrls | |
@Injectable | |
// two data bindings | |
[(ngModel)] | |
<input [(ngModel)]="object.stringa" placeholder="stringa"> | |
// operations | |
*ngFor | |
<li *ngFor="let element of elements"> | |
*ngIf | |
<div *ngIf="booleanCondition"> | |
// events | |
(click) | |
<li (click)="onSelect(hero)"> | |
// binders | |
[class.selected] | |
<li [class.selected]="booleanCondition"> | |
concepts of Declarations / Imports |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment