更新后,我已将 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/