diff --git a/angular-clndr.js b/angular-clndr.js index faff05a..42eaf2b 100644 --- a/angular-clndr.js +++ b/angular-clndr.js @@ -23,9 +23,7 @@ var options, render; $element.append(clone); $scope.$watch('events', function(val) { - if (val != null ? val.length : void 0) { - return $scope.clndr.setEvents(angular.copy(val)); - } + return $scope.clndr.setEvents(angular.copy(val || [])); }); render = function(data) { return angular.extend(scope, data); diff --git a/angular-clndr.min.js b/angular-clndr.min.js index e265192..78a58cc 100644 --- a/angular-clndr.min.js +++ b/angular-clndr.min.js @@ -3,4 +3,4 @@ * 10KB, http://10kb.nl/ * License: MIT */ -(function(){var a,b;b=angular.module("tien.clndr",[]),a=function(){var a,b;return b={clndr:"=tienClndrObject",events:"=tienClndrEvents",options:"=?tienClndrOptions"},a=["$scope","$element","$attrs","$transclude",function(a,b,c,d){return d(function(c,d){var e,f;return b.append(c),a.$watch("events",function(b){return(null!=b?b.length:void 0)?a.clndr.setEvents(angular.copy(b)):void 0}),f=function(a){return angular.extend(d,a)},e=angular.extend(a.options||{},{render:f}),a.clndr=angular.element("
").clndr(e)})}],{restrict:"E",replace:!0,transclude:!0,scope:b,controller:a}},b.directive("tienClndr",a)}).call(this); \ No newline at end of file +(function(){var a,b;b=angular.module("tien.clndr",[]),a=function(){var a,b;return b={clndr:"=tienClndrObject",events:"=tienClndrEvents",options:"=?tienClndrOptions"},a=["$scope","$element","$attrs","$transclude",function(a,b,c,d){return d(function(c,d){var e,f;return b.append(c),a.$watch("events",function(b){return a.clndr.setEvents(angular.copy(b||[]))}),f=function(a){return angular.extend(d,a)},e=angular.extend(a.options||{},{render:f}),a.clndr=angular.element("").clndr(e)})}],{restrict:"E",replace:!0,transclude:!0,scope:b,controller:a}},b.directive("tienClndr",a)}).call(this); \ No newline at end of file diff --git a/src/angular-clndr.coffee b/src/angular-clndr.coffee index 3516a0c..d5ad72d 100644 --- a/src/angular-clndr.coffee +++ b/src/angular-clndr.coffee @@ -18,7 +18,7 @@ TienClndrDirective = -> # watch events from tien-clndr-events attribute $scope.$watch 'events', (val) -> - $scope.clndr.setEvents(angular.copy(val)) if val?.length + $scope.clndr.setEvents(angular.copy(val || [])) # extend all CLNDR data to scope render = (data) ->