Angular directive for CLNDR.js
bower install --save angular-clndr
angular-clndr.js
.tien.clndr
to you app modules.tien-clndr
directive.
Use the tien-clndr
directive as element, all childs of this element have
CLNDR.js data available on the object provided with the tien-clndr-object
attributes. With this object on the child's scope, you can for example ng-repeat over the
days and render the template Angular-style.
Optionally pass an array of events
to the directive with the tien-clndr-events
attribute. Events are available
on the scope at day.events
, as shown in the example below:
To pass additional options on initialization of CLNDR, provide an options object to the
tien-clndr-options
attribute. See CLNDR Usage
for all possible settings. Heads up: the tien-clndr-options
object is only read
once during transclusion!
<tien-clndr class="clndr" tien-clndr-object="clndr" tien-clndr-events="events">
<div class="clndr-controls">
<div class="clndr-previous-button" ng-click="clndr.back()">
‹
</div>
<div class="month">
{{month}}
</div>
<div class="clndr-next-button" ng-click="clndr.forward()">
›
</div>
</div>
<div class="clndr-grid">
<div class="days-of-the-week">
<div class="header-day" ng-repeat="day in daysOfTheWeek track by $index">
{{day}}
</div>
</div>
<div class="days">
<div class="{{day.classes}}" ng-repeat="day in days">
<div class="event-indicator" ng-show="day.events.length" ng-click="showEvents(day.events)">{{day.events.length}}</div>
{{day.day}}
</div>
</div>
</div>
</tien-clndr>