Skip to content

Instantly share code, notes, and snippets.

View thomaswmanion's full-sized avatar

Tom Manion thomaswmanion

View GitHub Profile
@thomaswmanion
thomaswmanion / app-animate.class.ts
Created May 24, 2019 22:07
Enabling or Disabling Animations during Runtime in Angular
import { ɵNoopAnimationDriver, AnimationDriver, ɵWebAnimationsDriver } from '@angular/animations/browser';
export class AppAnimate implements AnimationDriver {
animationsDisabled = myVariableToDisableAnimations;
driver = this.animationsDisabled ? new ɵNoopAnimationDriver() : new ɵWebAnimationsDriver();
validateStyleProperty() {
return this.driver.validateStyleProperty.apply(this.driver, arguments);
}
matchesElement() {
return this.driver.matchesElement.apply(this.driver, arguments);
@thomaswmanion
thomaswmanion / add-hmr.sh
Last active April 18, 2022 20:01
Add HMR to Angular CLI
createEnvFile() {
production=$1
hmr=$2
file=$3
echo "export const environment = {" > $file
echo " production: $production," >> $file
echo " hmr: $hmr" >> $file
echo "};" >> $file
}