1.5.3 • Published 6 years ago

ng-lz-string v1.5.3

Weekly downloads
1,150
License
-
Repository
github
Last release
6 years ago

ng-lz-string

An Angular wrapper for lz-string. Built and tested for Angular 4. Should work for > Angular 4.

Installation

To install this library, run:

$ npm install ng-lz-string --save

Usage

Here's how you can use this library in your Angular app:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';

// Import your library
import { LZStringModule, LZStringService } from 'ng-lz-string';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,

    // Specify the LZ String Module as an import
    LZStringModule
  ],
  providers: [
	// Specify the service in the providers section
	LZStringService
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once your library is imported in your module, you can use it in your Angular application:

import {LZStringService} from 'ng-lz-string';

export class AppComponent implements OnInit {
	constructor(private lz: LZStringService){
	
	}
	
	performCompressionAndDecompression(){
		const compressed = this.lz.compress('This is going to be compressed');
		
		console.log(compressed);
		
		const decompressed = this.lz.decompress(compressed);
		
		console.log(decompressed);
	}
}
1.5.3

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.1

6 years ago

1.3.1

6 years ago

1.2.1

6 years ago

1.2.3

6 years ago

1.2.0

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.0

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago