Comparing version 0.3.1 to 0.3.2
/// <reference types="angular" /> | ||
/// <reference types="angular-mocks" /> | ||
import * as angular from 'angular'; | ||
export declare let $httpProvider: angular.IHttpProvider; | ||
export declare let $logProvider: angular.ILogProvider; | ||
export declare let $anchorScroll: angular.IAnchorScrollService; | ||
@@ -33,2 +35,1 @@ export declare let $cacheFactory: angular.ICacheFactoryService; | ||
export declare let $xhrFactory: any; | ||
export declare function bootstrap(moduleName: string): void; |
import * as angular from 'angular'; | ||
// import 'angular-mocks' | ||
// providers | ||
// TODO: add more | ||
export var $httpProvider = undefined; | ||
export var $logProvider = undefined; | ||
// services | ||
export var $anchorScroll = undefined; | ||
@@ -31,13 +37,2 @@ export var $cacheFactory = undefined; | ||
export var $xhrFactory = undefined; | ||
// bootstrap a dummy application using our module, so the #run block | ||
// below is synchronously called, and all of the injectables in it are | ||
// guaranteed to be defined after this code is run. | ||
// TODO: move this out into a separate module | ||
// TODO: tests | ||
export function bootstrap(moduleName) { | ||
var div = document.createElement('div'); | ||
document.body.appendChild(div); | ||
angular.bootstrap(div, [moduleName]); | ||
document.body.removeChild(div); | ||
} | ||
// prevent double-loading, which has the potential | ||
@@ -52,4 +47,6 @@ // to prevent sharing state between services | ||
} | ||
m.config(['$provide', function ($p) { | ||
$provide = $p; | ||
m.config(['$provide', '$httpProvider', '$logProvider', function ($a, $b, $c) { | ||
$provide = $a; | ||
$httpProvider = $b; | ||
$logProvider = $c; | ||
}]); | ||
@@ -87,2 +84,1 @@ // TODO: add mgMock/ngMockE2E services | ||
}]); | ||
bootstrap('bcherny/ngimport'); |
"use strict"; | ||
var angular = require('angular'); | ||
// import 'angular-mocks' | ||
// providers | ||
// TODO: add more | ||
exports.$httpProvider = undefined; | ||
exports.$logProvider = undefined; | ||
// services | ||
exports.$anchorScroll = undefined; | ||
@@ -32,14 +38,2 @@ exports.$cacheFactory = undefined; | ||
exports.$xhrFactory = undefined; | ||
// bootstrap a dummy application using our module, so the #run block | ||
// below is synchronously called, and all of the injectables in it are | ||
// guaranteed to be defined after this code is run. | ||
// TODO: move this out into a separate module | ||
// TODO: tests | ||
function bootstrap(moduleName) { | ||
var div = document.createElement('div'); | ||
document.body.appendChild(div); | ||
angular.bootstrap(div, [moduleName]); | ||
document.body.removeChild(div); | ||
} | ||
exports.bootstrap = bootstrap; | ||
// prevent double-loading, which has the potential | ||
@@ -54,4 +48,6 @@ // to prevent sharing state between services | ||
} | ||
m.config(['$provide', function ($p) { | ||
exports.$provide = $p; | ||
m.config(['$provide', '$httpProvider', '$logProvider', function ($a, $b, $c) { | ||
exports.$provide = $a; | ||
exports.$httpProvider = $b; | ||
exports.$logProvider = $c; | ||
}]); | ||
@@ -89,2 +85,1 @@ // TODO: add mgMock/ngMockE2E services | ||
}]); | ||
bootstrap('bcherny/ngimport'); |
import * as angular from 'angular' | ||
// import 'angular-mocks' | ||
// providers | ||
// TODO: add more | ||
export let $httpProvider: angular.IHttpProvider = undefined | ||
export let $logProvider: angular.ILogProvider = undefined | ||
// services | ||
export let $anchorScroll: angular.IAnchorScrollService = undefined | ||
@@ -33,14 +40,2 @@ export let $cacheFactory: angular.ICacheFactoryService = undefined | ||
// bootstrap a dummy application using our module, so the #run block | ||
// below is synchronously called, and all of the injectables in it are | ||
// guaranteed to be defined after this code is run. | ||
// TODO: move this out into a separate module | ||
// TODO: tests | ||
export function bootstrap(moduleName: string): void { | ||
const div = document.createElement('div') | ||
document.body.appendChild(div) | ||
angular.bootstrap(div, [moduleName]) | ||
document.body.removeChild(div) | ||
} | ||
// prevent double-loading, which has the potential | ||
@@ -55,4 +50,10 @@ // to prevent sharing state between services | ||
m.config(['$provide', ($p: angular.auto.IProvideService) => { | ||
$provide = $p | ||
m.config(['$provide', '$httpProvider', '$logProvider', ( | ||
$a: angular.auto.IProvideService, | ||
$b: angular.IHttpProvider, | ||
$c: angular.ILogProvider | ||
) => { | ||
$provide = $a | ||
$httpProvider = $b | ||
$logProvider = $c | ||
}]) | ||
@@ -91,2 +92,1 @@ | ||
}]) | ||
bootstrap('bcherny/ngimport') |
{ | ||
"name": "ngimport", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Finally, imports for Angular 1 builtins!", | ||
@@ -5,0 +5,0 @@ "main": "./ngimport.js", |
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
22286
379