@acomici/directives 中文文档教程

发布于 4年前 浏览 13 项目主页 更新于 3年前

Acomici Common Directives

这个存储库包括所有其他 Acomici 存储库中使用的最常见的 Angular 指令。 欢迎 PR 和问题。

此项目是使用 Angular CLI 版本 11.0.3 生成的。


Included Directives


acomiIsOutside

在您的组件模块中。

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

并在 HTML 组件中使用 在

<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

组件的模块中。

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

acomiOverCounted

在您的组件模块中。

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

Future document improvement:

每个指令的文档将被构建,因为一些指令有很多选项(acomiCarousel)。

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).

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文