Skip to content

An angular factory implementation of the javascript base 64 algorithm implemented by ncerminara

License

Notifications You must be signed in to change notification settings

dataminion/ng-base64

 
 

Repository files navigation

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!

About

An angular factory implementation of the javascript base 64 algorithm implemented by ncerminara

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%