我使用以下命令将 Angular 18 应用程序(带有独立组件standalone: true
)更新为 Angular 19 ng update
:
❯ Updates non-standalone Directives, Component and Pipes to 'standalone:false'
and removes 'standalone:true' from those who are standalone.
到目前为止一切顺利,所有内容都已standalone: true
被删除。
但是,Visual Studio Code 现在发出以下错误imports: [RouterLink, ...]
:
'imports' is only valid on a component that is standalone.
我错过了什么?
我遵循了以下指南: