Property 'forRoot' does not exist on type 'typeof NgReduxModule'
I've created a fresh project using angular cli. Tried using ng2-redux in it. But at the very first place I'm getting this error
ERROR in Error encountered resolving symbol values statically. Calling function 'NgReduxModule', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol AppModule in /Users/parminder/Documents/code/redux-test/src/app/app.module.ts, resolving symbol AppModule in /Users/parminder/Documents/code/redux-test/src/app/app.module.ts
ERROR in ./src/app/app.module.ts
Module build failed: Error: /Users/parminder/Documents/code/redux-test/src/app/app.module.ts (17,19): Property 'forRoot' does not exist on type 'typeof NgReduxModule'.)
at _checkDiagnostics (/Users/parminder/Documents/code/redux-test/node_modules/@ngtools/webpack/src/loader.js:116:15)
at /Users/parminder/Documents/code/redux-test/node_modules/@ngtools/webpack/src/loader.js:141:17
@ ./src/main.ts 5:0-45
@ multi main
Here's the code
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { NgReduxModule, NgRedux } from 'ng2-redux';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
NgReduxModule.forRoot()
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Straight from the docs, I've been using it. And I'm stuck in this error.
"forRoot" has been remove in 5.0 beta.0 (which is required if using latest angular). See: https://github.com/angular-redux/ng2-redux/blob/feat/v5/CHANGELOG.md
after applying as described in the latest CHANGELOG, I'm getting this error: "NgReduxModule is not an NgModule". this is the updated code:
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {FormsModule} from '@angular/forms';
import {HttpModule} from '@angular/http';
import {NgReduxModule, DevToolsExtension} from 'ng2-redux';
import {AppComponent} from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
NgReduxModule
],
providers: [DevToolsExtension, ],
bootstrap: [AppComponent]
})
export class AppModule { }
what else do I miss here?
@ronenl that usually indicates an angular version mismatch between a library and the app
The fix for the same has been made in 5.0.0-beta.2
Thanks! indeed the problem was solved in 5.0.0-beta.2
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.