George Kalpakas d89200ad24 refactor(docs-infra): remove unnecessary use strict from docs examples TS files (#38143)
By default, TypeScript will emit `"use strict"` directives, so it is not
necessary to include `'use strict'` in `.ts` files:
https://www.typescriptlang.org/docs/handbook/compiler-options.html#:~:text=--noImplicitUseStrict

PR Close #38143
2020-07-31 11:00:05 -07:00

42 lines
969 B
TypeScript

angular.
module('phonecatApp').
animation('.phone', function phoneAnimationFactory() {
return {
addClass: animateIn,
removeClass: animateOut
};
function animateIn(element: JQuery, className: string, done: () => void) {
if (className !== 'selected') { return; }
element.css({
display: 'block',
position: 'absolute',
top: 500,
left: 0
}).animate({
top: 0
}, done);
return function animateInEnd(wasCanceled: boolean) {
if (wasCanceled) { element.stop(); }
};
}
function animateOut(element: JQuery, className: string, done: () => void) {
if (className !== 'selected') { return; }
element.css({
position: 'absolute',
top: 0,
left: 0
}).animate({
top: -500
}, done);
return function animateOutEnd(wasCanceled: boolean) {
if (wasCanceled) { element.stop(); }
};
}
});