Ionic add plugin for android platform, then the codes what i write are gone?


#1

ionic: android platform add a plugin, then what i have written are gone

i create a new ionic demo

ionic start mydemo blank
cd mydemo
ionic platform add android
ionic build android

original index.html in mydemo/platforms/android/assets/www

original index.html

then i create controllers.js in mydemo/platforms/android/assets/www/js, add this js into index.html. change h1 content: “Ionic Blank Starter” to “My Ionic Demo”

edited index.html

then add cordova-sqlite-plugin

cordova plugin add https://github.com/litehelpers/Cordova-sqlite-storage.git

after plugin is installed, the controllers.js is gone, and index.html becomes the original one.

i try to install other plugins, there is the same problem.

did someone have the same issue? thank you


#2

you should never ever edit files in the platform/ folders. They will get overwritten.