Getting started Flashcards
Convention over configuration
Structure straight out of the box
Provides common solutions to common problems
Larger learning curve
Angular CLI
Build the project
Start a development server
Run tests
Deploy the app
Installation
Install NPM and Node
Then:
>npm install -g @angular/cli
angular version
> ng version
angular help
> angular help
command help
ng [command] –help
angular new app (CLI)
> ng new [project_name]
To update a project to a newer version
“Update Project Guide”
Development Server
A http server for development purposes only that track all changes to the project files
.editorconfig
Support many code editors across different team members
.gitignore
Allows to configure what is to be included in the git commit
angular.json
Angular allows many projects at the same time
architect section in angular.json
To compile the project
karma.config.js
testing Configuration
package.json
Project dependencies
tsconfig.app.json
Compiling options
src/main.ts
Main Entry to our App
compilation
the process of transforming code into machine code
JIT (Just In Time)
The source code gets compiled in our browser:
loads slower since the file size is larger than AOT and compiles and catch errors over the browser
AOT (Ahead On Time)
It compiles the code in the server
loads faster since the file size is smallest than AOT and compiles and catch errors over the server
AOT Dependency in angular projects
import {platformBrowser} from ‘@angular/platform-browser’;
platformBrowser()
JIT Dependency in angular projects
import {platformBrowserDynamic} from ‘@angular/platform-browser-dynamic’;
platformBrowserDynamic()
production mode
to avoid double load of content (change detection)
change detection happens when:
the app is initialized
after a change in the source code
manually triggering