Mohan Gopi
Mohan Gopi

Reputation: 7724

how to invoke full calendar in ionic 2

I am trying to invoke full calendar on clicking a button according to this documentation http://ionicframework.com/docs/v2/native/calendar/

i created a new project and installed this plugin after deplying the project into my device i am getting scuccess callback of numm but i am not able to see the calender in my UI

here is my code for .ts

import { Component } from '@angular/core';

import { NavController } from 'ionic-angular';

import {Calendar} from 'ionic-native';


@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public navCtrl: NavController) {

  }

  calender(){

    Calendar.createCalendar('MyCalendar').then(
      (msg) => { console.log("scuccess"+msg); },
      (err) => { console.log("error"+err); }
    );
  }

}

here is my html part

<button (click)="calender()" ion-button full>clickme</button>

can any one help how to get the full callender ui and i am not sure why i am getting null in my console.log of chorem://inspect

Upvotes: 1

Views: 3888

Answers (1)

Suraj Rao
Suraj Rao

Reputation: 29614

You need to open the calendar to view it.

public openCalendar():void{ 
Calendar.openCalendar(this.startDate); 
}

In the html:

<button (click)="openCalendar()" ion-button full>clickme</button>

Check example here

Upvotes: 1

Related Questions