https://github.com/rodrigoalvesvieira/angular-microtext
A tiny utility for processing text in your Angular.js apps
https://github.com/rodrigoalvesvieira/angular-microtext
angular-directives angularjs javascript microtext text-utility
Last synced: about 1 month ago
JSON representation
A tiny utility for processing text in your Angular.js apps
- Host: GitHub
- URL: https://github.com/rodrigoalvesvieira/angular-microtext
- Owner: rodrigoalvesvieira
- License: other
- Created: 2015-06-19T02:26:57.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-06-20T22:29:23.000Z (almost 11 years ago)
- Last Synced: 2025-03-16T07:11:27.525Z (over 1 year ago)
- Topics: angular-directives, angularjs, javascript, microtext, text-utility
- Language: HTML
- Homepage: http://rodrigoalvesvieira.github.io/angular-microtext
- Size: 191 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# angular-microtext
A tiny utility for processing text in your Angular apps. An Angular.js module implementation of the [original Microtext].
## Installation
You can install angular-microtext very easily via [Bower]. Simply execute:
`$ bower install angular-microtext`
## Usage
You only have to inject angular-microtext as a dependency of the app in which you wanna use it:
```javascript
angular.module('SampleApp', ['rodrigoalves.microtext']) // Oh yes
.controller('itemsController', function($scope) {
});
```
You can use it in your controllers, by also injecting `$filter`, like this:
```javascript
angular.module('SampleApp', ['rodrigoalves.microtext'])
.controller('itemsController', function($scope, $filter) {
$scope.appName = $filter("parameterize")("angular microtext"); // angular-microtext
});
```
Now you can use all the angular-microtext methods throughout your HTML templates:
```html
{{ 'The quick brown fox jumps over the lazy dog.' | truncate: 20 }}
{{ 'Ayrton Senna' | firstName }}
{{ 'Michael Phelps' | lastName }}
{{ 'James Cleveland Owens' | getInitials }}
{{ 'Lionel Messi' | abbrevName }}
{{ 'belchior' | capitalize }}
{{ 'rodrigovieira1994@gmail.com' | hideEmail }}
{{ "Who is John Galt" | excerpt: 'John' }}
{{ 'Bob Dylan' | parameterize }}
{{ 'Boneheaded' | hideBadWord }}
```
#### Sample
There's a small sample Angular.js app that uses angular-microtext inside the `sample` directory.
## Tests
## Author
* Rodrigo Alves
## License
Released under the MIT License. See LICENSE.txt for details.
Copyright (c) 2015 Rodrigo Alves
[original Microtext]: https://github.com/rodrigoalvesvieira/microtext.js
[Bower]: http://bower.io