Skip to content

InboxHealth/ember-cli-full-calendar

Repository files navigation

Ember CLI Full Calendar

Build Status Code Climate

This is a Ember wrapper for jQuery FullCalendar plugin.

Some of the common properties, methods have been hooked up. The rest will be added as required.

Installation

First, install the npm package:

npm install --save-dev ember-cli-full-calendar

Next, setup the component:

ember g full-calendar

Usage

Use the full-calendar component -

{{full-calendar events=events}}

Supported Options

Supported Callbacks

Setting Up Callbacks

All supported callbacks can be captured using Ember actions.

Add the component to your template file.

// app/templates/application.hbs
{{full-calendar events=model.events eventClick=(action "clicked") }}

Create the events.

// app/routes/application.js
import Ember from 'ember';

export default Ember.Route.extend({
	model: function() {
		return {
			events: Ember.A([{
				title: "Hackathon", start: Date.now()
			}])
		};
	}
});

Register for the action in your controller.

// app/controllers/application.js
import Ember from 'ember';

export default Ember.Controller.extend({
	actions: {
		clicked(event, jsEvent, view){
			console.log(`${event.title} was clicked!`)
			// Prints: Hackathon was clicked!
		}
	}
});

License

Available under the MIT License.