![](/img/trans.png)
[英]How to import not standalone components to a standalone component in Angular 14+
[英]how to initiate angular project with standalone component
現在 Angular 已經發布了獨立組件,我可以只使用獨立組件啟動 Angular 並一起刪除NgModule
嗎?
是的,您可以使用從main.ts
文件中的@angular/platform-browser
browser 導入的新引入的bootstrapApplication
這是完整的代碼
import { enableProdMode } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
bootstrapApplication(AppComponent)
.catch(err => console.error(err));
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.