accessibility icon indicating copy to clipboard operation
accessibility copied to clipboard

how to use with angular

Open AhmedHossamFCI opened this issue 1 year ago • 1 comments

just i am wondering how to use this lib with angular 18?

AhmedHossamFCI avatar Sep 17 '24 21:09 AhmedHossamFCI

Hi @AhmedHossamFCI You can use it just like you would with any other type of library, framework of vanilla javascript. I've actually tried it on some simple testing Angular app and it works as expected.

  1. Add the package to the dependencies section on the package.json file:
"accessibility": "*"

and run npm install. 2. Import the Accessibility class to the component that you want to display the tool (for example app.component.ts) like so:

import { Accessibility } from 'accessibility';
  1. Create a new instance of the class like this:
ngAfterViewInit() {
  setTimeout(async () => {
    new Accessibility();
  });
}

Please let me know if there are any issues with the tool in Angular.

ranbuch avatar Sep 18 '24 07:09 ranbuch