Use Angular components
Add Angular components with the @primate/angular
module.
npm install @primate/angular @angular/core @angular/common
import config from "primate/config";
import angular from "@primate/angular";
export default config({ modules: [angular()] });
// components/welcome.component.ts
import { Component, Input } from "@angular/core";
@Component({
selector: "app-welcome",
template: `<h1>Hello, {{ name }}!</h1>`,
})
export class WelcomeComponent {
@Input() name!: string;
}
// routes/index.ts
import route from "primate/route";
import response from "primate/response";
route.get(() => response.view("welcome.component.ts", { name: "World" }));