twinssbc/Ionic-Calendar

Custom templates not showing up

Closed this issue · 5 comments

I have created a custom monthview-event-detail-template-url in my project, however, when I run the project the custom component I created doesn't show up.

For example, I'm trying to modify the details section that is shown on the month view, however the same styles and elements are still there.

(in calendar-view.html)
<calendar monthview-event-detail-template-url="monthviewEventDetailTemplateUrl"></calendar>
(in calendar-view.ts)
customDetail: any = 'custom-detail.html';

What can I do to make it so I can modify these existing components and style them and shift the elements around in the HTML?

@jordanpurinton Are you using Ionic 1 or 2/4? Because I see you pasted some ts file.
If you bind the template to the variable 'monthviewEventDetailTemplateUrl' as below:

monthview-event-detail-template-url="monthviewEventDetailTemplateUrl"

You need to set the variable in your controller like below.

$scope.monthviewDisplayEventTemplateUrl = 'myTemplate.html';

Don't directly modify the default template code in templates/rcalendar, it won't take effect. Because you probably are referencing the calendar-tpls file which already bundle the default template code.

I'm using Ionic 2. And I did what you stated and it still isn't giving me the expected result. Here is a screenshot of what I'm working with.

capture

Ok, so I found the solution I was looking for here: https://www.npmjs.com/package/ionic2-calendar

For some reason the documentation is more up to date there instead of this GitHub page. It might be helpful to future people who use this to update the GitHub documentation to reflect Ionic 2/3 changes.

Thanks for the help and great calendar!

@jordanpurinton Actually this repository is for Ionic1 version. You should check the documentation under
https://github.com/twinssbc/Ionic2-Calendar

@twinssbc Oh, whoops. Well thanks!