Angular Introduction and Setup
Angular is a framework from Google for building full web apps. It gives you everything in one box: components, page routing, forms and tools to build and test. This tutorial uses Angular 20 and TypeScript (JavaScript with types).
Where React is a library for the UI, Angular is a complete framework: it comes with routing, forms, an HTTP client, testing tools and a command-line tool that creates and builds projects. Teams get one standard way of doing things, which is why Angular is popular in large companies, banks and enterprise apps. This very website, Terixto, is built with Angular.
Angular uses TypeScript, which adds types to JavaScript. Types help your editor suggest code and catch mistakes before the app runs - very helpful in big projects with many developers. If you know JavaScript, TypeScript is easy to pick up (see the TypeScript course).
Install and create an app
Install Node.js from nodejs.org first. Then run these commands in a terminal:
npm install -g @angular/cli
ng new my-shop
cd my-shop
ng serveng new creates a complete project with the right folder structure, settings and a working starter page. ng serve starts a local development server at port 4200 and rebuilds automatically when you save a file. The Angular CLI (ng) will be your main tool for creating components, services and production builds.
Open http://localhost:4200 in your browser. When you save a file, the page updates by itself.
ng new, not in the Try-it editor. Copy each example into your project to see it work.- Angular is a full framework from Google, built with TypeScript.
- Install the CLI with npm and create apps with
ng new. ng serveruns the app at localhost:4200.
