Docs

  1. Angular - Introduction to the Angular Docs
  2. Learn RxJS

Installation

// install nodejs

// install angular CLI
sudo npm install -g @angular/cli@latest

Problems of version?

// npm version 7.5.4 detected.
// The Angular CLI currently requires npm version 6.

// SOLUTION
// using nvm
<https://github.com/nvm-sh/nvm>

// Check the corresponding versions between nodejs - npm
<https://nodejs.org/en/download/releases/>
// install a specific version
nvm install 14
// check installed versions
nvm ls
// use
nvm use 14 // node version
// check version
npm -v
// if npm version is greater than usual? -> downgrade it
npm install -g npm@6 // eg. for node 14
// check where npm installed
which npm // should return /Users/thi/.nvm/versions/node/v14.15.5/bin/npm

CLI

// new app
ng new my-new-app

// serve
ng serve
ng serve --port 4300

// create component
ng generate component <name>
ng g c <name> # shorthand
ng g c <name> --skipTests true # without test files
ng g c <name> --selector <app-name> # with selector

// create directive
ng generate directive <name>
ng g d <name>

My first app

// crate an app / project
// for a moment, choose "No" for first 2 options + CSS
ng new my-first-app
cd my-first-app
ng serve // port 4200
ng serve --port 4300 // custom

Input changes → name changes ⇒ check commit → need [(ngModule)] ← from FormsModule ⇒ two-way binding!

Course Structure

Getting started → The basics → Components & Databinding → Directives → Services & Dependency Injection → Routing → Observables → Forms → Pipes → Http → Authentication → Optimizations & NgModules → Deployment → Animations & Testing

Untitled

TypeScript