From 9d093cd24c8d4c369a78ae0b4233b59fcd050f41 Mon Sep 17 00:00:00 2001 From: Dmitry Belyaev Date: Wed, 21 Jan 2015 14:52:07 +1100 Subject: [PATCH] Inject jQuery in a controllable way --- src/calendar.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/calendar.js b/src/calendar.js index 8663967..bbdceeb 100644 --- a/src/calendar.js +++ b/src/calendar.js @@ -8,6 +8,14 @@ * */ +(function(factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else { + factory(jQuery); + } +})(function($) { + angular.module('ui.calendar', []) .constant('uiCalendarConfig', {calendars: {}}) .controller('uiCalendarCtrl', ['$scope', @@ -286,4 +294,6 @@ angular.module('ui.calendar', []) }); } }; -}]); \ No newline at end of file +}]); + +});