I\'m trying to integrate AngularUI\'s calendar wrapper into my application, and the calendar initialization works fine. However, I don\'t see how I can call calendar methods
Okay, so it was pretty obvious in the source code, but I didn't understand on first glance. Here's a relevant snippet:
if(attrs.calendar){
scope.calendar = scope.$parent[attrs.calendar] = elm.html('');
}else{
scope.calendar = elm.html('');
}
This binds the calendar to the parent scope under the name that you declare when you write the calendar directive in your HTML. e.g.
<div ui-calendar="options" calendar="my-calendar-name" ng-model="events"></div>
This means I can call on the calendar's methods in my controller's scope. It was a feature implementation that I hadn't even considered yet! We need some docs for this script.