# lnl-angular-tools

> It is a Container of several services that easing life code in angular.

Latest version **1.0.0-rc.2** (published 2018-05-29) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install lnl-angular-tools
pnpm add lnl-angular-tools
yarn add lnl-angular-tools
bun add lnl-angular-tools
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0-rc.2 |
| Published | 2018-05-29 |
| First published | 2018-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 17.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nehemie Konan |
| Maintainers | legracieux535 |

## Links

- npm: https://www.npmjs.com/package/lnl-angular-tools
- Repository: https://github.com/legraxieux53/lnl-angular-tools
- Homepage: https://github.com/legraxieux53/lnl-angular-tools#readme
- Issues: https://github.com/legraxieux53/lnl-angular-tools/issues
- npm.io page: https://npm.io/package/lnl-angular-tools

## Recent versions

- 1.0.0-rc.2 (latest) — 2018-05-29
- 1.0.0 — 2018-05-25

## README

#lnl-angular-tools

It is a Container of several services that easing life code in angular.

##Install
1. install package
`npm install --save lnl-angular-tools`

2. In app module or auther module import: 

```javascript
import { BrowserModule } from '@angular/platform-browser';
...
import { LnlToolsModule } from 'lnl-angular-tools';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    ...
    LnlToolsModule
  ],
  providers: [...],
  bootstrap: [AppComponent]
})
export class AppModule { }


```

3. In services or components import services and enjoy

##Services
- [FileConverterService](#fileconverterservice)
- [LnlMiscService](#lnlmiscservice)


# FileConverterService
[Services list](#services) <br />
This service convert a file to base64 using an Observable

```typescript
import { Component, OnInit } from '@angular/core';
...
import { FileConverterService } from 'lnl-angular-tools';



@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
  
  static me;

  constructor(public fileConverter: FileConverterService) {
  	AppComponent.me = this;
  }

  ngOnInit() {
	this.convertImgToBase64(); // boostrap listener function for convertion file  
  }

  /**
   * listener function that perform request for convertion
   */
  convertImgToBase64()
  {
	this.fileConverter.init('#imginp', 'http://www.mysite.com/image.png');
   	this.fileConverter.champ.addEventListener('change', () => {
	   	let obs = this.fileConverter.convertToBase64()
	   	.subscribe({
	    	next(base64: any) {
	       		// we can get here Base64 string
	     	},
	     	error (err: any)  {
	       		//error of convertion base64
	     	}
	   	});
    });
  }


}
```
## FileConveterService documentation
### init (selector: string, default_link: string) : void
`selector` parameter is id of input <br />
`default_link` parameter is url of default file; good for images

### convertToBase64 () 
convert file to base64 and return an Observable

# LnlMiscService
[Services list](#services) <br />
this is mescelaneous service

## LnlMiscService documentation
### jsonToUrlEncoded(jsonElt: any[]) : string
convert a one level json array to urlencoded string

### orderedJsonId(obj : any[] | Object) : Object | any[]
order keys of an object and set old key as old_key propertie

#Licence

MIT License

Copyright (c) 2018 nehemie konan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---
_Source: https://npm.io/package/lnl-angular-tools · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
