Skip to content

Commit

Permalink
Unovis | Angular: Fix Stackblitz
Browse files Browse the repository at this point in the history
  • Loading branch information
lee00678 committed Apr 12, 2024
1 parent ba9096a commit 4550e91
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions packages/website/src/utils/stackblitz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,20 @@ function getStarterFiles (framework: Framework, e: Example): ProjectFiles {
return {
'src/index.html': '<app-component></app-component>',
'src/main.ts': trimMultiline(`
import 'zone.js/dist/zone'
import { NgModule, Component } from '@angular/core'
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
import { BrowserModule } from '@angular/platform-browser'
import 'zone.js'
import { Component } from '@angular/core'
import { bootstrapApplication } from '@angular/platform-browser'
import { ${e.codeAngular.module.match(/export class\s*(?<name>\S+)/).groups.name} as ComponentModule } from './${e.pathname}/${e.pathname}.module'
@Component({
selector: 'app-component',
imports: [ ComponentModule ],
standalone: true,
template: '<${e.pathname}></${e.pathname}>'
}) export class AppComponent { }
})
export class AppModule {}
@NgModule({
imports: [ BrowserModule, ComponentModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
platformBrowserDynamic().bootstrapModule(AppModule)
bootstrapApplication(AppModule)
`),
[`src/${e.pathname}/${e.pathname}.component.ts`]: e.codeAngular.component,
[`src/${e.pathname}/${e.pathname}.component.html`]: e.codeAngular.html,
Expand Down

0 comments on commit 4550e91

Please sign in to comment.