Instruction file imported from sight-client/sight-client (
.cursor/rules/angular-conventions.mdc). Copyright stays with the author.
Angular conventions
Match existing files. Do not introduce a second style.
- Standalone components; zoneless change detection (
provideZonelessChangeDetection()in tests). - File names omit
.component:draw-mark.ts, notdraw-mark.component.ts. - Colocate
*.ts/*.html/*.scss/*.spec.ts. Nest feature services underservices/<name>/. - Path aliases:
@/*→src/app/planet/*,@global/*→src/app/global/*,@landing/*→src/app/landing-page/*. - Selectors have no
app-prefix exceptapp-root(schematicprefixis empty). - Injected services are often
$serviceName. Keep that pattern in the file you edit. - SCSS; global mixins live in
src/app/global/stylesandsrc/app/planet/common/styles. - Tests: Vitest 4.1 via
ng test(@angular/build:unit-test, jsdom). Colocated*.spec.tswithTestBed+provideZonelessChangeDetection().
// ❌ BAD — new layer outside existing aliases
import { ViewerService } from 'src/app/planet/common/services/viewer-service/viewer.service';
// ✅ GOOD
import { ViewerService } from '@/common/services/viewer-service/viewer.service';