# Angular

An Angular 22 single-page app starter in TypeScript with standalone components, signals and lazy-loaded routes, for developers who want a current Angular CLI project without NgModules or Karma. It includes a layout shell, Home, About and 404 pages, strict type checks and unit tests run with Vitest.

- Framework: Angular (JavaScript)
- Category: Starters / Single-page apps
- Creates: a static site
- Plan: Free
- Price: Free
- Author: Light Cloud
- Page: https://templates.light-cloud.com/starters/single-page-apps/angular-starter
- Updated: 2026-11-21

## Features

- Standalone components with no NgModules, and a signal-based counter on the home page
- Every page lazy-loaded through loadComponent, with a browser tab title per route in app.routes.ts
- A layout shell in App (header, navigation, footer) around <router-outlet />
- Unit tests with Vitest through ng test, for the app shell and the counter
- TypeScript strict mode and strict Angular template checks, plus a Prettier config
- Production budgets: a warning at 500 kB initial bundle and an error at 1 MB
- Built with the Angular CLI application builder (@angular/build) into dist/browser/

## What you need

- Free plan: it builds to a static site, which the Free plan hosts with no limit on sites
- To run it locally: Node.js 20.19, 22.12 or later and npm
- No API keys: it starts with nothing to configure

## About

The project follows the current Angular CLI defaults: standalone components, signals, the application builder and Vitest, so it matches what the Angular docs now teach. Each route's component is its own chunk, and the budgets in angular.json fail the build if the initial bundle grows past 1 MB. There is no lint script yet, so adding angular-eslint is a sensible first change, followed by your own pages. Deploying runs npm run build and serves dist/browser/ from a CDN, with unknown paths falling back to index.html for the Angular Router.

## Questions

### How do I add a new page in Angular 22?

Run npx ng generate component pages/contact, add a route with loadComponent pointing at it in src/app/app.routes.ts, and add a routerLink in src/app/app.html.

### Does this Angular starter use NgModules or Karma?

Neither. Every component is standalone, and ng test runs the specs with Vitest, the default runner for new Angular CLI projects.

### How do I add environment settings to an Angular app?

Run npx ng generate environments to create development and production files in src/environments/. The template reads no environment variables today; the app title is the title field in src/app/app.ts.

### Why does my Angular route show a 404 after refreshing?

The host is looking for a file at that path and finds none. Configure it to serve index.html for unknown paths; Light Cloud does this for you.

### Can I host this Angular template without Light Cloud?

Yes. Run npm run build and serve dist/browser/ from any static host, such as Netlify, Firebase Hosting or nginx, with a fallback to index.html.
