Skip to content
This repository has been archived by the owner. It is now read-only.

custom template. first display does not work #279

Closed
cedricdev opened this Issue Feb 9, 2016 · 11 comments

Comments

Projects
None yet
2 participants
@cedricdev
Copy link

cedricdev commented Feb 9, 2016

Hello mattlewis92. many thanks for this project!

I've an issue. I want to use my custom template :
calendarConfig.templates.calendarMonthView = '/views/templates/calendar/calendarMonthView.html';

The first display does not work. only the first line of table is displayed.
when i change view (day, year...) and go back to Month, it is ok. the template is displayed.

there is the same problem for each custom template.

@mattlewis92

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 9, 2016

Are you setting the template url in the config phase of your app like this?
https://github.com/mattlewis92/angular-bootstrap-calendar#configuring-the-calendar-default-config

It might also be because the template isn't yet loaded into the templateCache if you're using an external template. You can get around this by inlining it like so:

<script type="text/ng-template" id="/views/templates/calendar/calendarMonthView.html">
  Template content here
</script>

I guess I could put in a check to ensure all templates are loaded first before rendering the calendar.

@cedricdev

This comment has been minimized.

Copy link
Author

cedricdev commented Feb 9, 2016

1 - Yes i 'm setting like the documentation (you can see my screen caps)
2 - I have tried the second solution. you can see it on the screen caps. it does not work. the template is never displayed.

mycontext

@mattlewis92

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 9, 2016

You're setting the custom url from the day view, but your actual template is the month view url which is why it isn't working.

@cedricdev

This comment has been minimized.

Copy link
Author

cedricdev commented Feb 9, 2016

ah ok. I have changed it. but i does not work. first display and after.
If i remove <script> line it's better because only the first display does not work.

@mattlewis92

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 9, 2016

Can you reproduce it in a plunker please? You can use this as a starter template: http://plnkr.co/edit/tursHHxWA8SdALaj0Bx6?p=preview

@cedricdev

This comment has been minimized.

Copy link
Author

cedricdev commented Feb 9, 2016

http://plnkr.co/edit/j9FD0hEPTcV7YJnm26XR?p=preview
it works with a plunker. when i click on day i can see my custom template 'jason bourne'. it is displayed at the first time i click on it. i do not need to click a second time.

@cedricdev

This comment has been minimized.

Copy link
Author

cedricdev commented Feb 9, 2016

the problem is only on firefox. IE and chrome are ok

@mattlewis92

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 9, 2016

I've added a check in 0.18.5 that will ensure all templates are pre-loaded into the cache before the calendar tries to render itself. Please can you upgrade to it and let me know if it fixes your problem. Thanks! 😄

@cedricdev

This comment has been minimized.

Copy link
Author

cedricdev commented Feb 10, 2016

ok. i start on month view. when i click on 'day' it works. i can see my custom template. it works!
There is an other problem. my page display on month view on first load. this view is not display. it is not a custom view.
The plunker http://plnkr.co/edit/j9FD0hEPTcV7YJnm26XR?p=preview show the problem.

@mattlewis92

This comment has been minimized.

Copy link
Owner

mattlewis92 commented Feb 10, 2016

Should be fixed in 0.18.7 😄

@cedricdev

This comment has been minimized.

Copy link
Author

cedricdev commented Feb 10, 2016

yes it is. good job

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.