<commit_before># ngx-asyncscripts
Lazy load scripts in a Angular 2 lazy loaded module? No probs!  


# How to install?  

`$ npm install ngx-asyncscripts`   

1. Import the Service  
```
import { NgXAsyncScripts } from 'ngx-asyncscripts';
```  

2. Use in your component  
For the second parameter of your dependencies array, you can use css or js.

```
export class AppComponent {


	constructor(private asyncLoaderService: NgXAsyncScripts)
	{

		/**
		 * Loads all the dependencies before proceeding
		 * @type {Array<Array<string | string>>}
		 */
		let dependencies = [
			["<DEPENDENCY_URL", "js"],
			["<DEPENDENCY_URL", "css"],
		]

		/**
		 * Load services and return a promise.
		 * Do stuff after promise resolves
		 */
		asyncLoaderService.loadServices(dependencies).then(
			function(success){
				console.log(success);
			}, function(error){
				console.log(error);
		});<commit_msg>Update readme again<commit_after># ngx-asyncscripts
Lazy loading scripts in an Angular 2 lazy loaded module? No probs!  


# How to install?  

`$ npm install ngx-asyncscripts`   

**Import the Service **   

```
import { NgXAsyncScripts } from 'ngx-asyncscripts';
```    

**Use in your component**
*For the second parameter of your dependencies array, you can use **css** or **js**

```
export class AppComponent {


	constructor(private asyncLoaderService: NgXAsyncScripts)
	{

		/**
		 * Loads all the dependencies before proceeding
		 * @type {Array<Array<string | string>>}
		 */
		let dependencies = [
			["<DEPENDENCY_URL", "js"],
			["<DEPENDENCY_URL", "css"],
		]

		/**
		 * Load services and return a promise.
		 * Do stuff after promise resolves
		 */
		asyncLoaderService.loadServices(dependencies).then(
			function(success){
				console.log(success);
			}, function(error){
				console.log(error);
		});
{'fraction_non_alphanumeric': 0.12341597796143251, 'fraction_numerical': 0.0022038567493112946, 'mean_word_length': 3.6208651399491094, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1805754', 'n_tokens_mistral': 634, 'n_tokens_neox': 543, 'n_words': 168}