Skip to content
This repository has been archived by the owner on Jun 19, 2018. It is now read-only.

custom template. first display does not work #279

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

custom template. first display does not work #279

cedricdev opened this issue Feb 9, 2016 · 11 comments

Comments

@cedricdev
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

@cedricdev
Copy link
Author

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
Copy link
Author

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

@mattlewis92
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

Should be fixed in 0.18.7 😄

@cedricdev
Copy link
Author

yes it is. good job

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants