Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benjamincharity/angular-url-encode
:arrows_counterclockwise: A simple Angular filter to URL-encode or decode a string.
https://github.com/benjamincharity/angular-url-encode
angularjs url-encoder
Last synced: 11 days ago
JSON representation
:arrows_counterclockwise: A simple Angular filter to URL-encode or decode a string.
- Host: GitHub
- URL: https://github.com/benjamincharity/angular-url-encode
- Owner: benjamincharity
- License: mit
- Created: 2016-02-12T16:18:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-07T23:00:20.000Z (about 8 years ago)
- Last Synced: 2024-10-22T19:00:38.094Z (17 days ago)
- Topics: angularjs, url-encoder
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# angular-url-encode
[![MIT License][license_image]][license_url] [![NPM version][npm_version_image]][npm_url]
:arrows_counterclockwise: A simple Angular filter to URL-encode or decode a string using `encodeURI`
and `decodeURI`.> [**:tv: Demo**][demo]
_[Comments and Pull Requests welcome!][issues]_
---
## Contents
- [Installation](#installation)
- [Dependencies](#dependencies)
- [Usage](#usage)
- [Development](#development)## Dependencies
- AngularJS (^1.4.0)
## Installation
#### NPM
```bash
$ npm install angular-url-encode --S
```#### Bower
```bash
$ bower install angular-url-encode --S
```#### Manually
Add the script and styles to your HTML:
```html
```
Add `bc.AngularUrlEncode` to your module's dependencies:
```javascript
angular.module('myModule', ['bc.AngularUrlEncode']);
```## Usage
#### HTML
As a filter in the DOM:
```html
{{ myPlainString | bcEncode }}
{{ encodedString | bcDecode }}
```#### JavaScript
Using the `$filter` service:
```javascript
// Encode
this.encodedString = $filter('bcEncode')(this.myPlainString);// Decode
this.decodedString = $filter('bcDecode')(this.encodedString);
```- - -
## Development
* `npm run build` - produces production version of your library under the `dist` folder
* `npm run dev` - produces development version of your library and runs a watcher- - -
[demo]: http://codepen.io/benjamincharity/pen/wzyNqQ?editors=1000
[issues]: https://github.com/benjamincharity/angular-url-encode/issues
[license_image]: http://img.shields.io/badge/license-MIT-blue.svg
[license_url]: LICENSE
[npm_url]: https://npmjs.org/package/angular-url-encode
[npm_version_image]: http://img.shields.io/npm/v/angular-url-encode.svg