formkit / auto-animate

A zero-config, drop-in animation utility that adds smooth transitions to your web app. You can use it with React, Vue, or any other JavaScript application.

Home Page:https://auto-animate.formkit.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Angular 16 support

irg1008 opened this issue · comments

Is there any plan to support Angular v16? The Ivy compiler doesn't work anymore

Happy to accept a PR.

Do we have an update on this by chance?

@KS2SoftwareGmbH there is a PR open here for 17 support. I’m not at all an angular dev, so Id love to see someone else help review it:

#206

If that works I can merge and publish

@KS2SoftwareGmbH

Do we have an update on this by chance?

I wrote that PR, but here is quick tip for v16:

Create a new directive in your project:

import {
  AfterViewInit,
  Directive,
  ElementRef,
  Input,
} from "@angular/core";
import autoAnimate, { AutoAnimateOptions } from '@formkit/auto-animate';

@Directive({
  selector: "[auto-animate]",
  standalone: true,
})
export class AutoAnimateDirective implements AfterViewInit {
  @Input() options: Partial<AutoAnimateOptions> = {};

  constructor(private el: ElementRef) {}

  ngAfterViewInit(): void {
    autoAnimate(this.el.nativeElement, this.options)
  }
}

And then you can just use it as any other directive.