We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to get started easily with Syncfusion Angular 6 Scheduler?

Platform: JavaScript - EJ 2 |
Control: Schedule |
Published Date: November 13, 2018 |
Last Revised Date: November 13, 2018

A quick start project that helps you to create an Angular 6 Scheduler with a minimal code configuration.

 

Angular 4 Scheduler displaying month view

 

Scheduler features covered in this Project

This is an Angular 6 project created using Angular CLI 6.2.7. The Scheduler features included in this project are as follows.

  • Angular 6 Scheduler displaying basic views with appointments loaded as JSON data.
  • Drag and resize actions enabled for events by default.
  • Setting current date and view for scheduler.
  • Setting specific timezone on scheduler.

 

Project pre-requisites

Make sure that you have the compatible versions of TypeScript and Angular in your machine before starting to work on this project.

  • Angular 6+
  • TypeScript 2.6+

 

Angular 6 Scheduler – Introduction

The Angular 6 Scheduler used in this project is created from the Syncfusion `ej2-angular-schedule` package. You can simply define it as <ejs-schedule> within the template.

 

Dependencies

Before starting with this project, the Angular 6 Scheduler requires to add the Syncfusion `ej2-angular-schedule` package from npmjs, which are distributed in npm as @syncfusion scoped packages.

 

Creating Angular Project

We will see the Angular project creation steps using the Angular CLI tool.

  1. Install the Angular CLI application in your machine.
  1. Now create a new Angular project by using the command `ng new` and navigate to that folder.
  1. Install the ej2-angular-schedule package through the npm install command.

Adding Angular 6 Scheduler

You can add the Angular 6 Scheduler component by using `ejs-schedule` directive and the attributes used within this tag allows you to define other scheduler functionalities.

  1. Import the ScheduleModule into app.module.ts file from the ej2-angular-schedule package.
  2. The next step in Angular Scheduler creation is to import and inject the other required modules within the providers section of app.module.ts.

 

[app.module.ts]

 

  1. Define the Angular Scheduler code within the app.component.html file which is mapped against the templateUrl option in app.component.ts file.

 

[app.component.html]

 

  1. Refer the CDN link of CSS reference within the index.html file.

 

[index.html]

 

  1. Try running the application with the command ng serve, and have an empty Scheduler displayed on the browser.  Now, let’s load the Scheduler with event data.

 

Loading appointment data

Let’s populate the empty Scheduler with appointments, by binding the local JSON event data to it through the dataSource property.

[app.component.ts]

 

Now assign this data source to the Angular Scheduler’s eventSettings property within the app.component.html file.

[app.component.html]

 

Enabling drag-and-resize options

To enable the drag and resize actions on Scheduler events, import the required module services from the ej2-angular-schedule package and then mention it in the providers section within the app.module.ts file.

[app.module.ts]

 

Setting current date and view

By default, Scheduler displays the current system date in Week view mode. To change both the display date as well as view mode, selectedDate and currentView property can be used.

[app.component.ts]

 

[app.component.html]

 

Setting timezone

To set specific timezone for Angular Scheduler, timezone property can be defined with valid timezone value. Here, let’s assign “UTC” to the timezone property of Scheduler, so that the events will get displayed on Scheduler with UTC time difference.

 

Run the application with the command “ng serve” in command prompt and you will be able to view the Angular Scheduler output with loaded appointments and other settings.

There are more options to explore with Angular 6 Scheduler and you can also try playing with the downloadable example link in this knowledge base article.

Downloadable example link: Angular 6 Scheduler

 

 

 

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon