1.0.19 • Published 7 years ago

angular2-fullcalendar v1.0.19

Weekly downloads
501
License
MIT
Repository
github
Last release
7 years ago

Angular 2: FullCalendar component

An Angular 2 component for fullcalendar.

Installation

npm install ap-angular2-fullcalendar --save

Usage

Import the calendar component

import {CalendarComponent} from "angular2-fullcalendar/src/calendar/calendar";
// other imports

@NgModule({
  declarations: [
    // other declarations
    CalendarComponent
  ],
  // ...
})
export class AppModule {}

Add config in my-component.ts

For a full list of options available, please refer to fullcalendar.io documentation at https://fullcalendar.io/docs/

@Component({
  selector: 'my-component',
  templateUrl: 'my-component.html'
})
export class MyComponent{
    calendarOptions:Object = {
        height: 'parent',
        fixedWeekCount : false,
        defaultDate: '2016-09-12',
        editable: true,
        eventLimit: true, // allow "more" link when too many events
        events: [
          {
            title: 'All Day Event',
            start: '2016-09-01'
          },
          {
            title: 'Long Event',
            start: '2016-09-07',
            end: '2016-09-10'
          },
          {
            id: 999,
            title: 'Repeating Event',
            start: '2016-09-09T16:00:00'
          },
          {
            id: 999,
            title: 'Repeating Event',
            start: '2016-09-16T16:00:00'
          },
          {
            title: 'Conference',
            start: '2016-09-11',
            end: '2016-09-13'
          },
          {
            title: 'Meeting',
            start: '2016-09-12T10:30:00',
            end: '2016-09-12T12:30:00'
          },
          {
            title: 'Lunch',
            start: '2016-09-12T12:00:00'
          },
          {
            title: 'Meeting',
            start: '2016-09-12T14:30:00'
          },
          {
            title: 'Happy Hour',
            start: '2016-09-12T17:30:00'
          },
          {
            title: 'Dinner',
            start: '2016-09-12T20:00:00'
          },
          {
            title: 'Birthday Party',
            start: '2016-09-13T07:00:00'
          },
          {
            title: 'Click for Google',
            url: 'http://google.com/',
            start: '2016-09-28'
          }
        ]
      };
  }
}

Add selector in template file my-component.html

<angular2-fullcalendar [options]="calendarOptions"></angular2-fullcalendar>

Import the fullcalendar css

If you're using Angular CLI, this is as simple as including one line in your style.css file:

@import "fullcalendar/dist/fullcalendar.min.css";

Alternatively, you can just reference the file directly. This would look something like

<link href="node_modules/fullcalendar/dist/fullcalendar.min.css" rel="stylesheet">

Use CalendarComponent as a ViewChild

export class MyComponent{
  @ViewChild(CalendarComponent) myCalendar: CalendarComponent;

  changeCalendarView(view) {
    this.myCalendar.fullCalendar('changeView', view);
  }

TODO's

  • Tests
1.0.19

7 years ago

1.0.18

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.0

8 years ago