This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10316|Reply: 0

[ionic] Understand the relationship between Ionic, Angular, Cordova, and plugins

[Copy link]
Posted on 6/27/2018 10:07:16 AM | | |
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.






Previous:New route 3 (newifi) digging digital gold tutorial
Next:ionic project-related operation commands
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com