twinssbc / Ionic-Calendar

A calendar directive for Ionic framework
http://twinssbc.github.io/Ionic-Calendar/demo
MIT License
159 stars 73 forks source link

Custom templates not showing up #149

Closed jordanpurinton closed 7 years ago

jordanpurinton commented 7 years ago

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) `

(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?

twinssbc commented 7 years ago

@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.

jordanpurinton commented 7 years ago

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

jordanpurinton commented 7 years ago

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!

twinssbc commented 7 years ago

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

jordanpurinton commented 7 years ago

@twinssbc Oh, whoops. Well thanks!