Skip to content

Instantly share code, notes, and snippets.

View matsko's full-sized avatar

Matias Niemelä matsko

View GitHub Profile
<script type="text/ng-template" id="form-template">
<div ng-messages>
<div ng-message="invalid">You entered an invalid value for this field</div>
<div ng-message="required">This value is required</div>
<div ng-message="minlength">Your value is too short</div>
</div>
</script>
<form>
<input name="myEmailInput" />
myModule.animation('.slide', function($animateStagger) {
return {
enter : function(element, done) {
return $animateStagger(element, function(index) {
});
}
}
});
describe('App', function() {
beforeEach(module('myApp'));
describe('itemHistory factory', function() {
it('should have working push and list functions', inject(function(itemHistory) {
itemHistory.push({ id : 1, title:'yes' });
expect(itemHistory.list()).toEqual([{ id :1, title:'yes'}]);
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;
}