https://github.com/bendrucker/angular-animate-change
Animate an element when a value changes
https://github.com/bendrucker/angular-animate-change
Last synced: about 1 year ago
JSON representation
Animate an element when a value changes
- Host: GitHub
- URL: https://github.com/bendrucker/angular-animate-change
- Owner: bendrucker
- License: mit
- Created: 2014-11-21T23:24:44.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-11-13T20:22:24.000Z (over 7 years ago)
- Last Synced: 2024-11-17T03:04:58.842Z (over 1 year ago)
- Language: JavaScript
- Size: 10.7 KB
- Stars: 15
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
angular-animate-change [](https://travis-ci.org/bendrucker/angular-animate-change)
======================
Angular directive for applying an animation class to an element whenever a value changes. Useful for applying attention-calling animation like flashes or shakes.
## Installing
```bash
# npm
$ npm install angular-animate-change
# bower
$ bower install angular-animate-change
```
## Setup
```js
// node module exports the string 'animate-change' for convenience
angular.module('myApp', [
require('angular-animate'),
require('angular-animate-change')
]);
// otherwise, include the code first then the module name
angular.module('myApp', [
'ngAnimate',
'animate-change'
]);
```
## API
##### `animateChange` (directive)
```html
```
When `$scope.value` changes, the class `'flash'` will be added. [Animation classes will applied during the transition](https://docs.angularjs.org/api/ngAnimate/service/$animate#addClass).