Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions napi/angular-compiler/vite-plugin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export function angular(options: PluginOptions = {}): Plugin[] {
},
configResolved(config) {
resolvedConfig = config
resolvedConfig.build.rolldownOptions.tsconfig = options.tsconfig
Comment thread
cursor[bot] marked this conversation as resolved.
Outdated
},
configureServer(server) {
viteServer = server
Expand Down
4 changes: 3 additions & 1 deletion napi/playground/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { Routes } from '@angular/router'

export const routes: Routes = []
import { CasesComponent } from './cases.component'

export const routes: Routes = [{ path: 'cases', component: CasesComponent }]
30 changes: 30 additions & 0 deletions napi/playground/src/app/cases.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Component, Injectable, inject, signal } from '@angular/core'
import { Observable, of, delay } from 'rxjs'

@Injectable({ providedIn: 'root' })
export class CifaPanelService {
onClose: Observable<boolean> = of(true)
}

@Component({
selector: 'app-cases',
template: '<div>Cases: {{ view() }}</div>',
standalone: true,
})
export class CasesComponent {
// Field using inject()
private cifaPanelService = inject(CifaPanelService)

// Field referencing the inject() field above - CRASHES with native class fields
// because cifaPanelService may not be initialized yet
private casesDrawerCloseChangeEvent$ = this.cifaPanelService.onClose.pipe(delay(0))

// Private field with signal
#view = signal<string>('home')
view = this.#view.asReadonly()

constructor() {
this.casesDrawerCloseChangeEvent$.subscribe()
console.log('CasesComponent view:', this.#view())
}
}
23 changes: 23 additions & 0 deletions napi/playground/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"isolatedModules": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "ES2022",
"useDefineForClassFields": false,
"module": "preserve",
"moduleResolution": "bundler"
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
21 changes: 1 addition & 20 deletions napi/playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,5 @@
{
"compilerOptions": {
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"isolatedModules": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "ES2022",
"module": "preserve",
"moduleResolution": "bundler"
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
},
"extends": "./tsconfig.base.json",
"references": [
{
"path": "../angular-compiler"
Expand Down
Loading
Loading