gpt4 book ai didi

node.js - angular2中的导航错误

转载 作者:IT老高 更新时间:2023-10-28 21:55:14 24 4
gpt4 key购买 nike

我已将 Angular 软件包版本从 2.4.10 更新到 4.0.0 更新后我在导航时遇到以下错误。

ERROR Error: Uncaught (in promise): Error: Found the synthetic property @transformPlaceholder. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application.
Error: Found the synthetic property @transformPlaceholder. Please include either "BrowserAnimationsModule" or "NoopAnimationsModule" in your application

我更改了 webpack.common.js 配置。看下面的代码

 new webpack.ContextReplacementPlugin(
// The (\\|\/) piece accounts for path separators in *nix and Windows
/angular(\\|\/)core(\\|\/)@angular/,
helpers.root('./src'), // location of your src
{} // a map of your routes
),

最佳答案

我已经解决了这个问题。我添加了一个新包:@angular/animations

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

我导入了模块:

@NgModule({
imports: [
BrowserAnimationsModule
]
})

关于node.js - angular2中的导航错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42994337/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com