Skip to content

aengus1/angular-lzwcompress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-lzwcompress

Angular 1 binding for the lzwcompress library.

This package provides a thin wrapper around LzwCompress to enable it to be easily used in an angular project.

Usage:

Browserify

Install lzwCompress from npm:

npm install --save angular-lzwcompress

Update package.json:

"browser": {    
    "lzwcompress": "./node_modules/angular-lzwcompress/index.js"
  }

Add a dependency to your angular module:

var app = angular.module('MyModule', [    
    require('angular-lzwcompress');
]);

Use it:

app.service('MyService',function($http,lzw) {
    return {
        fetchData: function (id) {			
			 return $http.get(ENV.API_URL + '/id')
                        .then(function (result) {
                          // to decompress anything from within JS
                    	    return lzw.unpack(result);
                    	    // to compress it
                    	    return lzw.pack(result);   
                    });                    
        }
    }
});

About

Angular 1 binding for the lzwcompress library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published