Open santoshcsdev opened 8 years ago
Hard to say with only bits and pieces of JS flying around.. did you check:
cordova.js
in your html?config.xml
?please reformat you code, so it's readable... I wouldn't look at this issue like that.
I am also getting this issue;
android.json
(/platforms/android/android.json)cordova build android
process:Discovered plugin "cordova-plugin-calendar" in config.xml. Adding it to the project
Installing "cordova-plugin-calendar" for android
Adding cordova-plugin-calendar to package.json
Saved plugin info for "cordova-plugin-calendar" to config.xml
window.cordova != null
)window.plugins == null
)Attempting to access window.plugins.calendar
to perform anything (getCreateCalendarOptions() for example) fails with "Uncaught TypeError: Cannot read property 'calendar' of undefined" when remotely debugging the app on Chrome 68 (running the app-debug.apk from Android Studio on a Android 6.0 device through USB).
I am using cordova-android version 7.1.1; any additional information or things I should try, please let me know!
Any updates or thoughts?
Some additional info:
Because of this, it appears that this script is not being run by Cordova - is there a way to determine why not?
Hi I am building a android app using ionic framework and angular JS.
I need to add a calendar event in my app ,when i run my app i am getting the issue "cannot read property calendar of undefined "
here are my .js codes //my app.js code // 'starter.services' is found in services.js // 'starter.controllers' is found in controllers.js angular.module('starter', ['ionic', 'starter.controllers','ngCordova'])
.run(function($ionicPlatform) { $ionicPlatform.ready(function() { // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard // for form inputs) if (window.cordova && window.cordova.plugins && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); cordova.plugins.Keyboard.disableScroll(true);
}); }) .config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('home', { url: '/home', templateUrl: 'templates/home.html', controller: 'HomeCtrl'
}) .state('login', { url: '/login', templateUrl: 'templates/login.html', controller: 'LoginCtrl' }) .state('register', { url: '/register', templateUrl: 'templates/register.html', controller: 'RegisterCtrl' })
.state('calendarevent', { url: '/calendarevent', templateUrl: 'templates/calendarevent.html', controller: 'CalendarCtrl'
});
//my controller.js code angular.module('starter.controllers', ['starter.services']){ .controller("CalendarCtrl", function($scope, $cordovaCalendar,calendarService) {
});
//I am using templates in ionic and the html code is
Calendar Event
/////////////
I have already installed cordova camera plugin using below command
cordova plugin add https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin.git
please suggest me in fixing my code. Thanks