search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Directive not working

Related article: AngularJS Event Calendar (Open-Source)
Asked by Anonymous
7 years ago.

Hi!
i added the Angular js scripts & daypilot and added a Directive to output the calendar, but can't see the calendar. What could be the problem?

Answer posted by Dan Letecky [DayPilot]
7 years ago.

If you don't see anything in the JavaScript console I recommend starting with the following minimum code:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>AngularJS Event Calendar</title>
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.7/angular.min.js"></script>
        <script src="https://javascript.daypilot.org/demo/lite/js/daypilot-all.min.js"></script>
    </head>
    <body>
        <div ng-app="main" ng-controller="CalendarController" >
          <daypilot-calendar id="calendar" daypilot-config="calendarConfig" daypilot-events="events" ></daypilot-calendar> 
        </div>
        <script>
            var app = angular.module('main', ['daypilot']).controller('CalendarController', ['$scope', '$timeout', '$http', function($scope, $timeout, $http) {
              $scope.calendarConfig = {
                  viewType: "Week",
                  startDate: new DayPilot.Date()
              };
              
              $scope.events = [];
            }]);
        </script>
    </body>
</html>
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.