Add Ionic 3 Plugin from Github Fork - ionic-framework

I want to add a plugin from a github fork of the InAppBrowser. This is the fork I want to use. I know how to add the plugin. I simply use Ionic Cordova plugin add https://github.com/al1lhomme/cordova-plugin-inappbrowser
But how can I import it to the modules.ts? I think it is necessary to add it to npm correct? I think I have to install the npm module to import it in my modules.ts file.
I tried to use cordova.plugins.InAppBrowser but it doesn't work.
Thanks to everyone.

You never add the Plugin to the Module. What you add to the Modules.ts is the native Wrapper from Ionic. You can use Plugins without this Wrapper, but they are developed for an easier use. I don't know if they work with Forks, normally they are developed to work with the original plugin.
So try to just add the Plugin via
ionic cordova plugin add path_to_fork
And use it without the Wrapper, as described in the Plugins Read Me

Related

How to create a babel plugin for internal use

How do we use a babel plugin that is not already accepted in a babel repository? I had trouble finding this answer reading through the babel plugin documentation.
We are interested in writing a babel plugin for for...in loops to address a bug in ios9 (ios9 Safari miscalculating sum). Although we would be happy to contribute it to the babel community, I was also wondering if it doesn't get accepted or isn't ready for general consumption, how to start using and testing it locally.
It's possible to make use of custom babel plugins that you can host on git.
You can refer to https://github.com/jamiebuilds/babel-handbook/blob/master/translations/en/plugin-handbook.md for learning how you can develop and test your babel plugin locally.
Once you have developed the plugin, you can add a dependency for it in your project's package.json file.
Note that if you plan to make the plugin repository private, you'd have to create a personal access token (for Github) to allow npm to fetch repository contents. In that case, the example entry in your package.json file would be as follows:
"babel-plugin-transform-for-of-loop": "git+https://{token}:x-oauth-basic#github.com/username/babel-plugin-transform-for-of-loop"
Whatever package name that you pick for your plugin, you will need to add a reference for it in the .babelrc file. For this example, it would be as follows:
{
...
"plugins": [
"babel-plugin-transform-for-of-loop"
]
}
With that done, you should simply run npm install and your plugin would become active for your project.

Add non native cordova plugin

How do I add non native cordova plugin? I have to add https://github.com/heigeo/cordova-plugin-tensorflow plugin. How to add and where to make necessary changes? If you have any such code please include here in answer. Thanks already.
The solution is in the readme of the link you have shared :
Execute - "cordova plugin add https://github.com/heigeo/cordova-plugin-tensorflow"

How to clone Ionic project to production

I have an Ionic Project, with all plugins, and libs and I am a little lost on how to manage so many plugins and libs.
Sometimes I install a plugin, test and after that install a couple of other plugins, and so on. After some time, I have so many plugins and I donĀ“t remember what are useful and what are not useful.
So, I would like to create another folder with a fresh version of my project, with only the necessary plugins and libs.
I am now using gulp to minify and uglyfy my code, and I will put all my minified files in this new folder.
So, my questions are:
Is there a simple way to verify what are the plugins and libs really necessary, without need to see it one by one ?
Is there a way to clone all my original project to another one, after I have already cleaned up the original folder ?
Thanks.
when you adding a plugin, you should call
ionic plugin "plugin-name" --save
it will save plugin information to your config.xml and package.json
next time, when your run ionic build, if plugins not install, it will auto install necessary plugins.
about npm module, you should call npm install "package-name" --save-dev to save your develop module, like gulp
in new project, you just copy the package.json and change project name and information, then call npm install, it will install the saved module.

How to extend angular-cli via a custom plugin

I want to extend angular-cli via a custom plugin. I want to write this plugin by myself. How can i do this? If i write an ember-cli plugin, can i use this one in angular-cli? I read that not all ember-cli plugins are working in angular-cli. I would like to have an example, or some information about the architecture of angular-cli.

Eclipse import Phonegap project

I have the HTML/JS/config.xml files of an app that was built using online phonegap build. How can I import these files into a project that I can work on with Eclipse/Phonegap CLI ?
The documentation here is all you need, just follow the steps.
http://cordova.apache.org/docs/en/4.0.0/guide_cli_index.md.html#The%20Command-Line%20Interface
First you will need to create a new project using your existing HTML/JS/CSS/icons
put your files in a folder, let's say c:\oldproject
create a new cordova project using the CLI and tell it to import your existing files (replace foldername, com.test.app and TestApp with proper values)
cordova create foldername com.test.app TestApp --copy-from=c:\oldproject
Replace phonegap.js reference with cordova.js
In index.html, replace the inclusion of phonegap.js with cordova.js (note that you may choose to use phonegap CLI instead of cordova CLI to create/build the project, in that case, you could continue to use phonegap.js)
Then put back the config and add plugins
replace the generated config.xml in the project with the one of your old project
If your config.xml contains plugins (lines begining with <gap:plugin) you will have to use the CLI to add each plugin.
For example if you have the line
<gap:plugin name="org.apache.cordova.file"
you would have to call
cordova plugin add org.apache.cordova.file
Then you have to add the android platform and build the project.
cordova platform add android
cordova build android
Now your project is ready to be imported in eclipse.
Please note that I don't really see any interest in using eclipse now that you can build projects using CLI. (I personnaly use a text editor that handles javascrit much better than eclipse and then do everything with the CLI).
Final warning
If you edit code in eclipse, you will be editing files in platforms/android/assets/www/, not in /www folder.
If you use the cli commands cordova build android or cordova prepare android, the CLI will take the content of the root www folder and put it in platforms/android/assets/www, so all your changes will be lost.
So if you choose to use eclipse to edit javascript/CSS, you will have to choose either save your changes to the root www folder before you use the CLI or stop using the CLI (so if you want to add a plugin you'd have to use plugman).