A
A
Anatoly2017-02-24 19:38:27
Angular
Anatoly, 2017-02-24 19:38:27

How to populate a calendar with events in Angular 2?

There is a calendar to display scheduled events for the current month:

<div class="calendar">
    <div class="day">1</div>
    <div class="day">2</div>
    <div class="day">3</div>
    ...
</div>

The component stores an array with data for specific days:
events = [
    {
        title: 'Event 1',
        date: '06/02/2017'
    },
    {
        title: 'Event 2',
        date: '15/02/2017'
    },
    {
        title: 'Event 3',
        date: '15/02/2017'
    },
    {
        title: 'Event 4',
        date: '20/02/2017'
    }
];

How to add a class only to those blocks that are in events ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rishat Sultanov, 2017-02-25
@rishatss

https://metanit.com/web/angular/2.8.php
And if you try this?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question