The concepts mentioned in this article do not distinguish between Ionic 1/Angular 1 and Ionic 2/Angular 2.
First of all, we need to clarify the following concepts:
1. Even if we make the mobile web page similar to the native application, we cannot call the native ability in our page like the native application.
2. Simple web pages cannot be submitted to the app store for use by users.
We then explain the relationship between them, respectively:
Ionic and Angular First of all, it should be clear that Ionic is a derivative of Angular, Angular is a separate JS library, which can be used independently for application development like jQuery, while Ionic only extends Angular, using Angular to implement many components that are suitable for mobile applications, and has built a very complete style library, which is the most successful application example of Angular. Even if you don't use Ionic, Angular can be used with any style library, such as Bootstrap, Foundation, etc., to get the desired page effect.
Ionic/Angular and Cordova Someone may ask, "Is Cordova better than Ionic/Angular?" This is very embarrassing, and it is a meaningless question at all. They play different roles in hybrid development – Ionic/Angular is responsible for the implementation of the page, while Cordova is responsible for wrapping the implemented page into a native application (Android: apk; iOS:ipa)。 Just like peanuts, the innermost peanut kernel is Angular, the skin of the peanut kernel is Ionic, and the outermost peanut shell is Cordova. After the packaging is completed, our page will be able to call the native capabilities of the device, and finally it can be uploaded to the app store for use by users.
Ionic/Angular and Cordova plugins The following points should be clarified about the Cordova plugin:
- The function of the Cordova plugin is to provide a bridge for pages and native communication, first of all, our pages cannot directly call device capabilities, so we need to connect with native code that can call device capabilities (Android: Java; iOS: OC) communication, at this point the Cordova plugin is required.
- The Cordova plugin can be used in any Cordova project, regardless of the front-end framework (e.g. Ionic) used.
- Ionic Native is encapsulated in Ionic 2, which facilitates the use of Cordova plugins, but in Ionic 2 it is still possible to use Cordova plugins as in Ionic 1, and Ionic Native is not required.
- Even if you use Ionic Native in Ionic 2, you first need to manually add plugins, such as cordova plugin add cordova-plugin-pluginName.
|