angular-url-encode
🔄 A simple Angular filter to URL-encode or decode a string using encodeURI
and decodeURI
.
Comments and Pull Requests welcome!
Contents
Dependencies
- AngularJS (^1.4.0)
Installation
NPM
$ npm install angular-url-encode --S
Bower
$ bower install angular-url-encode --S
Manually
Add the script and styles to your HTML:
Add bc.AngularUrlEncode
to your module's dependencies:
angular;
Usage
HTML
As a filter in the DOM:
{{ myPlainString | bcEncode }}{{ encodedString | bcDecode }}
JavaScript
Using the $filter
service:
// EncodethisencodedString = thismyPlainString; // DecodethisdecodedString = thisencodedString;
Development
npm run build
- produces production version of your library under thedist
foldernpm run dev
- produces development version of your library and runs a watcher