Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
98
rated 0 times [  99] [ 1]  / answers: 1 / hits: 12841  / 10 Years ago, fri, september 5, 2014, 12:00:00

I have an Ionic app built with Angular.



I am using is Calendar plugin:
https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin



I want to create events through the plugin and save them to the local device's calendar.



I have added the plugin though:



cordova plugin add https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin.git


And I try to use it in my controller:



 ionic.Platform.ready(function(){onError);
window.plugins.calendar.createEvent(title, location, notes, start, end, onSuccess, onError);
});


In the browser it says window.plugins is undefined and on the device the error is 'undefined' is not an object (evaluating 'window.plugins.calendar')



I have searched high and low for this, I cant seem to find a solution that works.



Any idea how to use a Cordova plugin with Ionic?


More From » angularjs

 Answers
2

The answer was to add



<script src=cordova.js></script>


And rebuild the Platforms



If still issue not resolved, remove and add the platforms


[#42686] Thursday, September 4, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
anitamaeg

Total Points: 466
Total Questions: 106
Total Answers: 106

Location: Suriname
Member since Sun, Jun 13, 2021
3 Years ago
;