Comparing version 0.0.3 to 0.0.4-0
{ | ||
"name": "get-js", | ||
"version": "0.0.3", | ||
"version": "0.0.4-0", | ||
"description": "A lightweight promise based package to load scripts on the fly", | ||
"main": "index.js", | ||
"dependencies": {}, | ||
"dependencies": { | ||
"angular": "^1.3.*" | ||
}, | ||
"devDependencies": { | ||
@@ -15,3 +17,3 @@ "babel-cli": "^6.7.7", | ||
"transpile": "babel src -d lib", | ||
"bundle": "webpack -d --output-filename get.js && webpack -p --output-filename get.min.js", | ||
"bundle": "./resources/scripts/bundle.sh", | ||
"build": "npm run transpile && npm run bundle", | ||
@@ -35,3 +37,5 @@ "prepublish": "npm run build" | ||
"get", | ||
"es6" | ||
"es6", | ||
"angular", | ||
"$q" | ||
], | ||
@@ -42,2 +46,3 @@ "files": [ | ||
"index.js", | ||
"angular.js", | ||
"LICENSE", | ||
@@ -44,0 +49,0 @@ "README.md", |
@@ -60,1 +60,32 @@ # Get JS | ||
``` | ||
## Using in Angular Projects | ||
You can also inject this in your angular files as a `$q` friendly angular service. | ||
Require the angular module using | ||
```javascript | ||
var angularGetJs = require('get-js/angular'); | ||
``` | ||
Or | ||
```html | ||
<script type="text/javascript" src="/path/to/get-js/dist/angular-get.min.js"></script> | ||
``` | ||
Then you should be able to use it like this | ||
```javascript | ||
// Add the module as a dependeny in your app | ||
angular.module('app', ['angularGetJs']); | ||
// Inject the service | ||
angular.module('app') | ||
.controller('MyController', ['get', function(get) { | ||
get('/some/script.js') | ||
.then(function() { | ||
console.log('do something now'); | ||
}) | ||
.catch(function() { | ||
console.log('error'); | ||
}); | ||
}]); | ||
``` |
Sorry, the diff of this file is not supported yet
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
35689
15
457
90
1
+ Addedangular@^1.3.*
+ Addedangular@1.8.3(transitive)