1.5.1 • Published 7 years ago

ng-base64 v1.5.1

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
7 years ago

Angular Base64

An angular factory implementation of the javascript base64 algorithm as proposed by ncerminara

You can view the original gist here

Version 1.5 update

I have rewritten the library to be more in line with module design in angular 1.6. Additionall the code has been cleaned up to allow for minification and we have build a minified version into the release.

Installing it

Install with npm and link to the installed file using the script tag

npm install ng-base64

Usage

Add a reference to angular-base64.js in your html:

 <script src="<PATH>/angular-base64.js" type="text/javascript"></script>

or

 <script src="<PATH>/angular-base64.min.js" type="text/javascript"></script>

Add a reference to ngBase64 in angular application config section:

	var myApp = angular.module('myApp',
		[
    		'ngBase64'
		]);   

Inject base64 into a controller or directive in your application:

	.controller('AppCtrl', function($log, base64) {
		$log.log(base64.encode('Hello World!'));
		$log.log(base64.decode('SGVsbG8gV29ybGQh'));
	})

Enjoy!