Skip to content

Simple implementation of base64 download files for angularjs applications

License

Notifications You must be signed in to change notification settings

saulsluz/angular-base64-download

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-base64-download

Simple implementation of base64 download files for angularjs applications

Installation

Bower

$ bower install angular-base64-download

Embed it in your HTML:

<script src="./bower_components/angular-base64-download/base64-download.js"></script>

NPM

$ npm install angular-base64-download

Embed it in your HTML:

<script src="./node_modules/angular-base64-download/base64-download.js"></script>

Dependency injection

Inject angular-base64-download module as a dependency into your app:

var app = angular.module('app', [
  'ngBase64Download'
])

Usage

Example of minimum usage:

In controller:

angular.controller('myCtrl',['base64DownloadFactory',function(base64DownloadFactory){
  base64DownloadFactory.download('data:text/plain;base64,aGVsbG8=', 'MyFileHello', 'txt')
}]);

Will download a file called "MyFileHello.txt" with content "hello".

That's all.

See ./demos for interactive usage example.

Tests

To run the package's test, first install the dependencies, then run npm test:

$ npm install --only=dev
$ bower install

or

$ npm install

License

MIT License

About

Simple implementation of base64 download files for angularjs applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published