angular-component
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -1,2 +0,2 @@ | ||
/*! angular-component v0.0.4 | (c) 2016 @toddmotto | https://github.com/toddmotto/angular-component */ | ||
/*! angular-component v0.0.5 | (c) 2016 @toddmotto | https://github.com/toddmotto/angular-component */ | ||
(function () { | ||
@@ -28,5 +28,10 @@ | ||
var closure; | ||
if (angular.isFunction(fn) || angular.isArray(fn)) { | ||
closure = function closure(tElement, tAttrs) { | ||
return $injector.invoke(fn, this, { | ||
var isArray = angular.isArray(fn); | ||
if (angular.isFunction(fn) || isArray) { | ||
return function (tElement, tAttrs) { | ||
return $injector.invoke((isArray ? fn : [ | ||
'$element', | ||
'$attrs', | ||
fn | ||
]), this, { | ||
$element: tElement, | ||
@@ -36,4 +41,2 @@ $attrs: tAttrs | ||
}; | ||
closure.$inject = ['$element', '$attrs']; | ||
return closure; | ||
} else { | ||
@@ -40,0 +43,0 @@ return fn; |
@@ -1,2 +0,2 @@ | ||
/*! angular-component v0.0.4 | (c) 2016 @toddmotto | https://github.com/toddmotto/angular-component */ | ||
!function(){function t(t,n){if(n&&"string"==typeof n)return n;if("string"==typeof t){var e=/^(\S+)(\s+as\s+(\w+))?$/.exec(t);if(e)return e[3]}}function n(){function n(n,e){function o(n){function r(t){var e;return angular.isFunction(t)||angular.isArray(t)?(e=function(e,r){return n.invoke(t,this,{$element:e,$attrs:r})},e.$inject=["$element","$attrs"],e):t}return{controller:e.controller||angular.noop,controllerAs:t(e.controller)||e.controllerAs||"$ctrl",template:r(e.template||e.templateUrl?e.template:""),templateUrl:r(e.templateUrl),transclude:void 0===e.transclude?!0:e.transclude,scope:e.bindings||{},bindToController:!!e.bindings,restrict:e.restrict||"E"}}return e.$canActivate&&(o.$canActivate=e.$canActivate),e.$routeConfig&&(o.$routeConfig=e.$routeConfig),o.$inject=["$injector"],r.directive(n,o)}var r=e.apply(this,arguments);return r.component?r:(r.component=n,r)}var e=angular.module;angular.module=n}(); | ||
/*! angular-component v0.0.5 | (c) 2016 @toddmotto | https://github.com/toddmotto/angular-component */ | ||
!function(){function t(t,n){if(n&&"string"==typeof n)return n;if("string"==typeof t){var r=/^(\S+)(\s+as\s+(\w+))?$/.exec(t);if(r)return r[3]}}function n(){function n(n,r){function o(n){function e(t){var r=angular.isArray(t);return angular.isFunction(t)||r?function(e,o){return n.invoke(r?t:["$element","$attrs",t],this,{$element:e,$attrs:o})}:t}return{controller:r.controller||angular.noop,controllerAs:t(r.controller)||r.controllerAs||"$ctrl",template:e(r.template||r.templateUrl?r.template:""),templateUrl:e(r.templateUrl),transclude:void 0===r.transclude?!0:r.transclude,scope:r.bindings||{},bindToController:!!r.bindings,restrict:r.restrict||"E"}}return r.$canActivate&&(o.$canActivate=r.$canActivate),r.$routeConfig&&(o.$routeConfig=r.$routeConfig),o.$inject=["$injector"],e.directive(n,o)}var e=r.apply(this,arguments);return e.component?e:(e.component=n,e)}var r=angular.module;angular.module=n}(); |
{ | ||
"name": "angular-component", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"main": "./dist/angular-component.min.js", | ||
@@ -5,0 +5,0 @@ "description": "Angular component() polyfill", |
@@ -84,2 +84,6 @@ # angular-component.js | ||
- 0.0.5 | ||
- Add automatic function annotations | ||
- 0.0.4 | ||
- Fix Array dependency annotations [#11](https://github.com/toddmotto/angular-component/issues/11) | ||
- 0.0.3 | ||
@@ -86,0 +90,0 @@ - Fix bug caused by bugfix (aligns with new 1.5 changes) |
@@ -27,5 +27,10 @@ (function () { | ||
var closure; | ||
if (angular.isFunction(fn) || angular.isArray(fn)) { | ||
closure = function closure(tElement, tAttrs) { | ||
return $injector.invoke(fn, this, { | ||
var isArray = angular.isArray(fn); | ||
if (angular.isFunction(fn) || isArray) { | ||
return function (tElement, tAttrs) { | ||
return $injector.invoke((isArray ? fn : [ | ||
'$element', | ||
'$attrs', | ||
fn | ||
]), this, { | ||
$element: tElement, | ||
@@ -35,4 +40,2 @@ $attrs: tAttrs | ||
}; | ||
closure.$inject = ['$element', '$attrs']; | ||
return closure; | ||
} else { | ||
@@ -39,0 +42,0 @@ return fn; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11954
185
94
0