I noticed that there seem to be two ways to load things like Ionic Storage:
-
https://ionicframework.com/docs/storage/
import { IonicStorageModule } from ‘@ionic/storage’;
@NgModule({
declarations: [
// …
],
imports: [
IonicModule.forRoot(MyApp),
IonicStorageModule.forRoot()
],
bootstrap: [IonicApp],
entryComponents: [
// …
],
providers: []
})
export class AppModule {} -
https://alligator.io/ionic/storage-ionic/
import { Storage } from ‘@ionic/storage’;
@NgModule({
…
providers: [ Storage ]
})
Is the second just outdated or can both ways be done?
If so, what’s the difference between the two?