New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-es-utils

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-es-utils - npm Package Compare versions

Comparing version 1.2.14 to 1.2.15

48

injector/index.js

@@ -6,2 +6,3 @@ 'use strict';

});
exports.getInjector = getInjector;

@@ -14,16 +15,39 @@ var _angular = require('angular');

var injector = null; /**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-04-25
*/
var injector = null;
var bootstrap = _angular2.default.bootstrap;
/**
* 获取应用的injector,默认查询被ng-app标记的节点,否则从document.body开始找
* @param rootElement
*/
/**
* @author Kuitos
* @homepage https://github.com/kuitos/
* @since 2016-04-25
*/
// rewrite angular bootstrap method to assign our injector
_angular2.default.bootstrap = function () {
injector = bootstrap.apply(undefined, arguments);
return injector;
};
function getInjector() {
var rootElement = arguments.length <= 0 || arguments[0] === undefined ? document.querySelector('[ng-app]') || document.body : arguments[0];
var injector = _angular2.default.element(rootElement).injector();
if (injector) {
return injector;
} else {
var childNodes = rootElement.childNodes;
for (var i = 0; i < childNodes.length; i++) {
var _injector = getInjector(childNodes[i]);
if (_injector) {
return _injector;
}
}
}
return null;
}
// make commonjs have the same behavior with es6 module

@@ -35,3 +59,3 @@ Object.defineProperty(exports, 'default', {

get: function get() {
return injector;
return injector || getInjector();
}

@@ -38,0 +62,0 @@ });

{
"name": "angular-es-utils",
"version": "1.2.14",
"version": "1.2.15",
"description": "es utils design for angular1.x",

@@ -5,0 +5,0 @@ "main": "./index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc