Angular-calendar: Provide a way of overriding each components templates

Created on 3 Jul 2016  路  9Comments  路  Source: mattlewis92/angular-calendar

馃帀馃帀馃帀 This is now completed, see https://github.com/mattlewis92/angular-calendar/issues/16#issuecomment-288164932 for how to use it 馃帀 馃帀馃帀

Plan of action:

  • [x] move calendarDayViewEventComponent business logic up into the parent day view component. All child components will now be "dumb" and easier to pass a custom template in
  • [x] refactor month view header into its own component
  • [x] refactor week view header into its own component
  • [x] make all dumb child components accept a custom template like this
  • [x] expose all child components from the module entry point - this will let users use component inheritance to extend any of the components

Additional demos to add:

  • [x] custom templates
  • [x] group month view events
enhancement

Most helpful comment

I aim on getting it done in the next month or so 馃槃

All 9 comments

Hi thanks for porting this to angular 2 we were using it in angular on and we are now upgrading. We could like to add labels to the event dots. Like include counts or some custom text. Is this possible yet.

You can customise the tooltips but not the actual templates yet.

@mattlewis92 thanks. It is not really a showstopper but it would be nice to have.

I aim on getting it done in the next month or so 馃槃

@mattlewis92 I believe for us to have this feature angular 4.x.x will be a hard dependency or do you plan on getting away to support 2.x.x

Yeah I realised we'd have to wait for angular 4 to drop (in 2 weeks time). However the upgrade should be seamless for most users so I don't consider it a big deal.

Custom templates are now available as of 0.9.0! 馃帀 You can either extend the main components to override the entire template or for most use cases just a specific part of the component with the <template> tag. There is a demo of how to do that here for the month cell, for all places you can pass a template in see the commits on the changelog. Please feedback to me if this meets enough use cases 馃槃

This is awesome! Thank you!

Here you said, that you need to wait for angular 4 to make this possible. But your component looks like its built on 2.3.x. I鈥榤 confused. What is the correct dependency to use custom templates?

In the end I landed on a solution that uses v2, so you should be able to use it seamlessly 馃榾

Was this page helpful?
0 / 5 - 0 ratings