Skip to content

Commit dd56c25

Browse files
committed
added syntax for supporting ng-strict-di
1 parent e121bb3 commit dd56c25

File tree

3 files changed

+22
-20
lines changed

3 files changed

+22
-20
lines changed

angular-clndr.js

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,26 @@
1717
events: '=tienClndrEvents',
1818
options: '=?tienClndrOptions'
1919
};
20-
controller = function($scope, $element, $attrs, $transclude) {
21-
return $transclude(function(clone, scope) {
22-
var options, render;
23-
$element.append(clone);
24-
$scope.$watch('events', function(val) {
25-
if (val != null ? val.length : void 0) {
26-
return $scope.clndr.setEvents(angular.copy(val));
27-
}
20+
controller = [
21+
"$scope", "$element", "$attrs", "$transclude", function($scope, $element, $attrs, $transclude) {
22+
return $transclude(function(clone, scope) {
23+
var options, render;
24+
$element.append(clone);
25+
$scope.$watch('events', function(val) {
26+
if (val != null ? val.length : void 0) {
27+
return $scope.clndr.setEvents(angular.copy(val));
28+
}
29+
});
30+
render = function(data) {
31+
return angular.extend(scope, data);
32+
};
33+
options = angular.extend($scope.options || {}, {
34+
render: render
35+
});
36+
return $scope.clndr = angular.element("<div/>").clndr(options);
2837
});
29-
render = function(data) {
30-
return angular.extend(scope, data);
31-
};
32-
options = angular.extend($scope.options || {}, {
33-
render: render
34-
});
35-
return $scope.clndr = angular.element("<div/>").clndr(options);
36-
});
37-
};
38+
}
39+
];
3840
return {
3941
restrict: 'E',
4042
replace: true,

angular-clndr.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/angular-clndr.coffee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ TienClndrDirective = ->
1212
events: '=tienClndrEvents'
1313
options: '=?tienClndrOptions'
1414

15-
controller = ($scope, $element, $attrs, $transclude) ->
15+
controller = ["$scope", "$element", "$attrs", "$transclude", ($scope, $element, $attrs, $transclude) ->
1616
$transclude (clone, scope) ->
1717
$element.append(clone)
1818

@@ -29,7 +29,7 @@ TienClndrDirective = ->
2929

3030
# init CLNDR in virtual DOM-element
3131
$scope.clndr = angular.element("<div/>").clndr(options)
32-
32+
]
3333
return {restrict: 'E', replace: true, transclude: true, scope: scope, controller: controller}
3434

3535
module.directive('tienClndr', TienClndrDirective)

0 commit comments

Comments
 (0)