我已将 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/