@acomici/directives

Common Angular directives modules

Usage no npm install needed!

<script type="module">
  import acomiciDirectives from 'https://cdn.skypack.dev/@acomici/directives';
</script>

README

Acomici Common Directives

This repository includes most common Angular directives that are used in all other Acomici repositories. PR and issues are welcomed.

This project was generated with Angular CLI version 11.0.3.


Included Directives


acomiIsOutside

In your component's module.

@NgModule({
  imports: [
    ClickOutsideModule
  ],
})
export class SomeModule {
}

And use in HTML component

<div acomiIsOutside (isOutside)="isClickingOutside($event)" (outside)="whenOutside()">
  Some DOM
</div>
// your component.ts
/**
 * `isOutSide` will be true if user click outside the DOM.
 * and false when click inside the DOM (or any child DOM)
 * this is useful if you want to detect exactly when user click in or outside the DOM.
 */
isClickingOutside(isOutside: boolean) {
  // ...
}

/**
 * Use this if you only want to trigger when user click outside the DOM.
 */
whenOutside() {
  // ...
}

acomiCarousel

In your component's module.

@NgModule({
  imports: [
    CarouselModule
  ],
})
export class SomeModule {
}
  • Updating...

acomiOverCounted

In your component's module.

@NgModule({
  imports: [
    OverCountedModule
  ],
})
export class SomeModule {
}
  • Updating...

Future document improvement:

Document for each directive will be constructed as some directive have lots of options (acomiCarousel).