Angular documentation
Official Angular docs (components, templates, DI, routing).
Official Angular docs (components, templates, DI, routing).
npm i -g @angular/cli
ng new my-app
cd my-app
ng serve
Prefer standalone components + route-based composition.
Keep shared UI in libs/ or a shared folder.
import { Component } from "@angular/core";
@Component({
standalone: true,
selector: "app-hello",
template: `<h1>{{ title }}</h1>`,
})
export class HelloComponent {
title = "Hello";
}
import { Component } from "@angular/core";
@Component({
standalone: true,
selector: "app-list",
template: `<ul><li *ngFor="let x of xs">{{ x }}</li></ul>`,
})
export class ListComponent {
xs = ["a", "b", "c"];
}
import { Component, Input } from "@angular/core";
@Component({
standalone: true,
selector: "app-title",
template: `<h1>{{ title }}</h1>`,
})
export class TitleComponent {
@Input() title = "";
}