Skip to content

Instantly share code, notes, and snippets.

@silversonicaxel
Last active March 13, 2022 02:11
Show Gist options
  • Save silversonicaxel/5b4733009a44be0c39402fe20e3e8e00 to your computer and use it in GitHub Desktop.
Save silversonicaxel/5b4733009a44be0c39402fe20e3e8e00 to your computer and use it in GitHub Desktop.
ANGULAR #angular
// 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
@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