node.js - angular2中的导航错误

标签 node.js angular webpack-2 typescript2.1

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

相关文章:

json - 我如何在 Angular 中提供 JSON?

javascript - 使用 webos 将 html5 canvas 元素保存到文件

Angular2 使用组件外部的动画

javascript - Angular 2可以激活: retrieve value in component

angular2,读取到的内容是: property used for in ViewChild?

webpack 多个输入文件和多个输出文件

javascript - 导入在子文件夹中不起作用

node.js - 错误 : The process "node.exe" not found

javascript - 在 Node.js (Express) Facebook Canvas 应用程序中获取 signed_request

node.js - Elasticsearch中的搜索查询