Home > Blockchain >  Difference between Plugin/Api implementation with @ionic/angular and @capacitor/XXX
Difference between Plugin/Api implementation with @ionic/angular and @capacitor/XXX

Time:10-18

I update an app to ionic 5 with capacitor.

Before that, ionic 3 was used with Cordova.

If I want to display an ActionSheet in the app now, I have two options.

Either via @ ionic / angular I import the ActionSheetController which is called in the constructor. https://ionicframework.com/docs/api/action-sheet#methods

Or I install and import the Capacitor Action-Sheet Api

import {ActionSheet} from '@ capacitor / action-sheet'; https://capacitorjs.com/docs/apis/action-sheet

Now my question is what, besides the implementation, is the difference between the two. Or is there an argument to use for or against one of them?

That’s also available for others Plugins/Apis

CodePudding user response:

@capacitor/action-sheet uses native action sheets on iOS/Android, while Ionic action-sheet uses a web component that looks like the native action sheet.

You can use whatever you like, but remember that Capacitor can be used without Ionic, so not everybody can use Ionic's action-sheet.

  • Related