Merged Anshul's angular JS code blindly with ionic app code