如何在离子cordova中集成日历?

时间:2016-01-07 09:41:34

标签: angularjs cordova calendar ionic-framework

我想在离子angularjs cordova应用程序中集成日历。

我使用本教程https://blog.nraboy.com/2015/02/using-native-device-calendar-ionic-framework/

但我发现了这个错误

  

!JavaScript ERROR:'undefined'不是对象(评估'n.plugins.calendar.createEvent')       http://localhost:58779/js/ng-cordova.min.js:7

我的控制员:

.controller("evenementCalendarController", function($scope, $cordovaOauth, $localStorage, $location,$ionicPopup,$state,$http,$cordovaCalendar) {

     $scope.createEvent = function() {
            $cordovaCalendar.createEvent({
                title: 'Space Race',
                location: 'The Moon',
                notes: 'Bring sandwiches',
                startDate: new Date(2015, 0, 15, 18, 30, 0, 0, 0),
                endDate: new Date(2015, 1, 17, 12, 0, 0, 0, 0)
            }).then(function (result) {
                console.log("Event created successfully");
            }, function (err) {
                console.error("There was an error: " + err);
            });
        }   

});

这是什么错误以及如何解决?

0 个答案:

没有答案