Angular Overview
Angular is an SPA framework, once very popular, nowadays rather losing interest year by year. It has its legacy though, I think it did a pretty good job of popularizing TypeScript. Interestingly, it uses TypeScript’s Decorators feature, which is experiemntal since as long as I remember (and I started with Angular 2, and we’re at Angular 14 at the moment I’m writing this).
Installation
Go to https://angular.io/cli and follow the instructions.
Basic Commands
-
ng new my-app
- creates a new app (togethre with its directory) -
ng serve -o
- local development server,-o
opens the browser automatically atlocalhost:4200
-
ng generate component whatever
- or simlyng g c whatever
- generates a new component.
Modules
By default, the app has the AppModule
module. We can also create more of them.
A module is like a package that bundles things together. With simple apps, the
default AppModule
is enough. Each component needs to be registered in some
module (in the declarations
array).
More on modules can be found here.