From 4550e9123f7a407f83236a25b98e0415348fef4e Mon Sep 17 00:00:00 2001 From: lee00678 Date: Thu, 11 Apr 2024 13:58:12 -0700 Subject: [PATCH] Unovis | Angular: Fix Stackblitz --- packages/website/src/utils/stackblitz.ts | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/packages/website/src/utils/stackblitz.ts b/packages/website/src/utils/stackblitz.ts index 88e4aa079..99b386fc9 100644 --- a/packages/website/src/utils/stackblitz.ts +++ b/packages/website/src/utils/stackblitz.ts @@ -37,25 +37,20 @@ function getStarterFiles (framework: Framework, e: Example): ProjectFiles { return { 'src/index.html': '', '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*(?\S+)/).groups.name} as ComponentModule } from './${e.pathname}/${e.pathname}.module' @Component({ selector: 'app-component', + imports: [ ComponentModule ], + standalone: true, template: '<${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,