🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

ngimport

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngimport - npm Package Compare versions

Comparing version

to
0.0.7

karma.conf.js

11

ngimport.es6.js

@@ -41,4 +41,13 @@ import * as angular from 'angular';

}
// prevent double-loading, which has the potential
// to prevent sharing state between services
let m = null;
try {
m = angular.module('bcherny/ngimport');
}
catch (e) {
m = angular.module('bcherny/ngimport', []);
}
// TODO: add mgMock/ngMockE2E services
angular.module('bcherny/ngimport', []).run(['$injector', function ($i) {
m.run(['$injector', function ($i) {
$anchorScroll = $i.get('$anchorScroll');

@@ -45,0 +54,0 @@ $cacheFactory = $i.get('$cacheFactory');

@@ -43,4 +43,13 @@ "use strict";

exports.bootstrap = bootstrap;
// prevent double-loading, which has the potential
// to prevent sharing state between services
let m = null;
try {
m = angular.module('bcherny/ngimport');
}
catch (e) {
m = angular.module('bcherny/ngimport', []);
}
// TODO: add mgMock/ngMockE2E services
angular.module('bcherny/ngimport', []).run(['$injector', function ($i) {
m.run(['$injector', function ($i) {
exports.$anchorScroll = $i.get('$anchorScroll');

@@ -47,0 +56,0 @@ exports.$cacheFactory = $i.get('$cacheFactory');

14

ngimport.ts

@@ -44,4 +44,13 @@ import * as angular from 'angular'

// prevent double-loading, which has the potential
// to prevent sharing state between services
let m: angular.IModule = null
try {
m = angular.module('bcherny/ngimport')
} catch (e) {
m = angular.module('bcherny/ngimport', [])
}
// TODO: add mgMock/ngMockE2E services
angular.module('bcherny/ngimport', []).run(['$injector', function($i: angular.auto.IInjectorService) {
m.run(['$injector', function($i: angular.auto.IInjectorService) {
$anchorScroll = <angular.IAnchorScrollService>$i.get('$anchorScroll')

@@ -76,3 +85,2 @@ $cacheFactory = <angular.ICacheFactoryService>$i.get('$cacheFactory')

}])
bootstrap('bcherny/ngimport')
bootstrap('bcherny/ngimport')
{
"name": "ngimport",
"version": "0.0.6",
"version": "0.0.7",
"description": "Finally, imports for Angular 1 builtins!",

@@ -11,4 +11,4 @@ "main": "./ngimport.js",

"watch": "tsc -w",
"test": "ava",
"tdd": "npm test -- --watch"
"test": "karma start --log-level debug --single-run",
"tdd": "karma start"
},

@@ -34,4 +34,18 @@ "repository": {

"devDependencies": {
"angular-mocks": "^1.5.5",
"browserify": "^13.0.1",
"jasmine": "^2.4.1",
"jasmine-core": "^2.4.1",
"karma": "^0.13.22",
"karma-browserify": "^5.0.5",
"karma-chrome-launcher": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-mocha-reporter": "^2.0.3",
"karma-source-map-support": "^1.1.0",
"rollupify": "^0.3.0",
"typings": "^0.7.12"
},
"dependencies": {
"angular": "^1.5.5"
}
}

@@ -1,6 +0,10 @@

# ngimport [![Circle CI](https://circleci.com/gh/bcherny/ngimport/tree/master.svg?style=svg)](https://circleci.com/gh/bcherny/ngimport/tree/master)
# ngimport [![Build Status][build]](https://circleci.com/gh/bcherny/ngimport) [![npm]](https://www.npmjs.com/package/ngimport) [![mit]](https://opensource.org/licenses/MIT)
[build]: https://img.shields.io/circleci/project/bcherny/ngimport.svg?branch=master&style=flat-square
[npm]: https://img.shields.io/npm/v/ngimport.svg?style=flat-square
[mit]: https://img.shields.io/npm/l/ngimport.svg?style=flat-square
> A saner alternative to Angular 1 dependency injection
**docs and tests coming soon...**
**alpha**

@@ -111,5 +115,5 @@ ## Example

Angular 1 DI made sense when there was no JavaScript module standard. But with the advent of CommonJS, and now ES Modules, Angular DI only serves to make your code less portable.
Angular 1 DI made sense when there was no JavaScript module standard. But with the advent of CommonJS, and now ES Modules, Angular DI only makes your code less portable.
If you add TypeScript to the mix, you'll often find yourself repeating class interface definitions; you might create a typed service class, but because its dependencies are injected via a closure, you can't export the class directly, and instead need to create a second interface and export it instead! And if you use the class' constructor to inject dependencies, then you can't pass arguments to a new instance of your constructor!
If you add TypeScript to the mix, you'll often find yourself repeating class interface definitions: you might create a typed service class, but because its dependencies are injected via a closure, you can't export the class directly, and instead need to create a second interface and export it instead! And if you use the class' constructor to inject dependencies, then you can't pass arguments to a new instance of your constructor!

@@ -132,3 +136,3 @@ With the *ngimport* approach, all of these issues are solved.

You can easily use the same technique that *ngimport* uses to expose your own, legacy Angular 1 modules via ES7 `import`s. Let's say you have the following code:
You can easily use the same technique that *ngimport* uses to expose your own, legacy Angular 1 modules via ES6 `import`s. Let's say you have the following code:

@@ -170,8 +174,2 @@ ```js

## Backporting existing code
TODO
TODO
## License

@@ -183,3 +181,3 @@

TODO
`npm test`

@@ -186,0 +184,0 @@ ## Todo