Skip to content

Instantly share code, notes, and snippets.

View matsko's full-sized avatar

Matias Niemelä matsko

View GitHub Profile
angular.module('disableAnimations', ['ngAnimate']).run(['$rootScope','$animate', function($rootScope, $animate) {
$animate.enabled(false);
$rootScope.$evalAsync(function() {
$animate.enabled(false);
});
}]);
function animationsDisabled(element, parent) {
if(element == $rootElement) {
return rootAnimateState.disabled || rootAnimateState.running;
}
var validState;
do {
//the element did not reach the root element which means that it
//is not apart of the DOM. Therefore there is no reason to do
//any animations on it
function filter(exp) {
return function filterHandler(array) {
var newArray = [];
for(var i=0;i<array.length;i++) {
var a = array[i];
if(exp(a)) {
newArray.push(a);
}
}
return newArray;
//
// PROGRAM
//
function filter(exp) {
return function(array) {
var newArray = [];
for(var i=0;i<array.length;i++) {
var a = array[i];
if(exp(a)) {
newArray.push(a);
.animate {
transition: border 1s, background 2s, color 3s;
}
element.on('transitionend', callback);
function callback(event) {
//Chrome, FF, Safari
//border
//background
<style>
.show-hide.ng-show,
.show-hide.ng-hide {
transition:0.5s linear all;
-webkit-transition:0.5s linear all;
-moz-transition:0.5s linear all;
-o-transition:0.5s linear all;
}
.show-hide.ng-show {...}
<style>
//CSS
.show-hide.ng-hide-add,
.show-hide.ng-hide-remove {
transition:0.5s linear all;
-webkit-transition:0.5s linear all;
-moz-transition:0.5s linear all;
-o-transition:0.5s linear all;
display:block!important;
}
animator.animate('ng-hide-add', element).then(function() {
addClass('ng-hide');
});
<div ng-animate="{misko:'animation-name'}" ng-class="{misko:$index == 0}"></div>
echo "hello"