

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Cheat Sheet on AngularJS, a JavaScript-based open-source front-end web framework
Typology: Cheat Sheet
1 / 2
This page cannot be seen from the preview
Don't miss anything!
groupe-sii.github.io/cheat-sheets www.groupe-sii.com blog.groupe-sii.com
Bootstraps the app, using the root component from the
speci ed NgModule.
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
platformBrowserDynamic() .bootstrapModule(AppModule);
De nes a module that contains components,
directives, pipes, and providers.
import { NgModule } from '@angular/core';
@NgModule({ declarations: [ myRootComponent, myComponent, myDirective, myPipe], imports: [myModule, npmModule], exports: [myComponent], providers: [myService], bootstrap: [myRootComponent]// Only root module }) class MyModule {}
The pipes and directive is declared as components
Component
@Component({ selector: 'app-my', templateUrl: './my.component.html', styleUrls: ['./my.component.css'] }) class MyComponent() {}
Directive
@Directive({ selector: 'app-my', templateUrl: './my.directive.html', styleUrls: ['./my.directive.css'] }) class MyDirective() {}
Pipe
@Pipe({name: 'myPipe'}) class MyPipe() {}
Provider
@Injectable() class MyService() {}
Add{providedIn: root} option for create singleton
groupe-sii.github.io/cheat-sheets www.groupe-sii.com blog.groupe-sii.com
ngIf
*<span ngIf="hero">{{ hero.name }} exists !
ngFor
*<span ngFor="let hero of heroes; let i=index">{{ hero.name }} is at index {{ i }}
ngSwitch
**<div [ngSwitch]="hero.class"> <span *ngSwitchCase="'knight'">You are strong <span *ngSwitchCase="'mage'">You are intelligent <span *ngSwitchDefault>You are special
Angular module: http://www.learn-angular.fr/les- modules-angular/
Template syntax: https://angular.io/guide/template- syntax