Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 5a1538e

Browse files
mark0978joshkurz
authored andcommitted
Added docs about watching the displayed date range
1 parent d6129b1 commit 5a1538e

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A complete AngularJS directive for the Arshaw FullCalendar.
1212

1313
# Testing
1414

15-
We use karma and grunt to ensure the quality of the code.
15+
We use karma and grunt to ensure the quality of the code.
1616

1717
npm install -g grunt-cli
1818
npm install
@@ -50,7 +50,7 @@ Apply the directive to your div elements. The calendar must be supplied an array
5050

5151
## Options
5252

53-
All the Arshaw Fullcalendar options can be passed through the directive. This even means function objects that are declared on the scope.
53+
All the Arshaw Fullcalendar options can be passed through the directive. This even means function objects that are declared on the scope.
5454

5555
myAppModule.controller('MyController', function($scope) {
5656
/* config object */
@@ -76,7 +76,7 @@ All the Arshaw Fullcalendar options can be passed through the directive. This ev
7676

7777
The ui-calendar directive plays nicely with ng-model.
7878

79-
An Event Sources objects needs to be created to pass into ng-model. This object will be watched for changes and update the calendar accordingly, giving the calendar some Angular Magic.
79+
An Event Sources objects needs to be created to pass into ng-model. This object will be watched for changes and update the calendar accordingly, giving the calendar some Angular Magic.
8080

8181
The ui-calendar directive expects the eventSources object to be any type allowed in the documentation for the fullcalendar. [docs](http://arshaw.com/fullcalendar/docs/event_data/Event_Source_Object/)
8282
Note that all calendar options which are functions that are passed into the calendar are wrapped in an apply automatically.
@@ -86,11 +86,11 @@ Note that all calendar options which are functions that are passed into the cale
8686
To avoid potential issues, by default the calendar object is not available in the parent scope. Access the object by declaring a calendar attribute name:
8787

8888
<div ui-calendar="calendarOptions" ng-model="eventSources" calendar="myCalendar">
89-
89+
9090
Now the calendar object is available in the parent scope:
9191

9292
$scope.myCalendar.fullCalendar
93-
93+
9494
This allows you to declare any number of calendar objects with distinct names.
9595

9696
## Custom event rendering
@@ -108,11 +108,25 @@ If you need to automatically re-render other event data, you can use `calendar-w
108108
<ui-calendar calendar-watch-event="extraEventSignature" ... >
109109
// will now watch for price
110110

111+
## Watching the displayed date range of the calendar
112+
113+
There is no mechanism to $watch the displayed date range on the calendar due to the JQuery nature of fullCalendar. If you want
114+
to track the dates displayed on the calendar so you can fetch events outside the scope of fullCalendar (Say from a caching store
115+
in a service, instead of letting fullCalendar pull them via AJAX), you can add the viewRender callback to the calendar config.
116+
117+
$scope.calendarConfig = {
118+
calendar:{
119+
height: "100%",
120+
...
121+
viewRender: function(view, element) {
122+
$log.debug("View Changed: ", view.visStart, view.visEnd, view.start, view.end);
123+
}
124+
}
125+
};
126+
111127
## Documentation for the Calendar
112128

113129
The calendar works alongside of all the documentation represented [here](http://arshaw.com/fullcalendar/docs)
114130

115-
## PR's R always Welcome
116-
PR's are welcome at any time.
131+
## PR's R always Welcome
117132
Make sure that if a new feature is added, that the proper tests are created.
118-
We are following a linear approach to this directives history, so PR's are never merged through github's client.

0 commit comments

Comments
 (0)