I am getting this error in my service
Cannot find name 'Network'.
I have installed the ionic plugin add cordova-plugin-network-information
and here is my service
import { Network } from '@ionic-native/network';
@Injectable()
export class DataService {
constructor(private network: Network) { }
}
You need to install the npm package too:
npm install @ionic-native/network --save
thanks @joshmorony this fixes Cannot find name 'Network' but I am still getting this Uncaught Error: Cannot find module "@ionic-native/core"
I just wanted to check network status before making any HTTP request, any other way doing this, currently I am adding this check in my HTTP wrapper DataService.
You also need to import into your app.module.ts file and add it as a provider there.
I ran this command and it gives me this error.
â-- UNMET PEER DEPENDENCY typescript@2.0.9
try to call it after device ready event
which one has been add in app.module.ts
After I imported Network in app.module.ts and added Network in providers list, it gives the error
"Type âNetworkOriginalâ is not assignable to type âProviderâ.
_ Type âNetworkOriginalâ is missing the following properties from type âFactoryProviderâ: provide, useFactory [2322]"_
now after import to app.module.ts is showing error