# @bugsplat/ngx-animated-counter 中文文档

规范地址：https://npmcn.com/package/%40bugsplat/ngx-animated-counter/

版本：18\.0\.0
npm 元数据更新时间：2024-07-18T21:30:31.834Z
中文译文更新时间：2026-11-08T20:41:06.224Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40bugsplat/ngx-animated-counter
原文对照：https://npmcn.com/package/%40bugsplat/ngx-animated-counter/?lang=original
项目主页：https://github.com/BugSplat-Git/ngx-animated-counter#readme
源码仓库：https://github.com/BugSplat-Git/ngx-animated-counter

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：27.2 kB，14 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- 运行依赖：1 个
- peer 依赖：@angular/common \>=6\.0\.0，@angular/core \>=6\.0\.0
- 首次发布：2022-02-10T23:19:46.360Z
- 最新版本发布：2024-07-18T21:30:31.678Z
- 近 30 天下载量：2282（2026-10-09 至 2026-11-07，npm 官方下载统计）
- 已发布版本数：4（近 12 个月 0 个）

## 中文简介

[![bugsplat-github-banner-basic-outline](https://user-images.githubusercontent.com/20464226/149019306-3186103c-5315-4dad-a499-4fd1df408475.png)](https://bugsplat.com/)

## 安装

```sh
npm install @bugsplat/ngx-animated-counter
```

也可以使用：`pnpm add @bugsplat/ngx-animated-counter`、`yarn add @bugsplat/ngx-animated-counter`、`bun add @bugsplat/ngx-animated-counter`

## README

[![bugsplat-github-banner-basic-outline](https://user-images.githubusercontent.com/20464226/149019306-3186103c-5315-4dad-a499-4fd1df408475.png)](https://bugsplat.com/)  

# 

BugSpla

### **

为繁忙的开发者构建了崩溃和错误报告 .

**

 [![Follow @bugsplatco on Twitter](https://img.shields.io/twitter/follow/bugsplatco?label=Follow%20BugSplat&style=social)](https://twitter.com/BugSplatCo)[![Join BugSplat on Discord](https://img.shields.io/discord/664965194799251487?label=Join%20Discord&logo=Discord&style=social)](https://discord.gg/K4KjjRV5ve)

## 导 言

BugSplate 的标签 [@ bugsplat/ngx-活化-counter](https://www.npmjs.com/package/@bugsplat/ngx-animated-counter) 软件包提供简单的倒数上下数动画。 看一看我们 [实例](https://bugsplat-git.github.io/ngx-animated-counter-example/) 这证明了我们的动画计数器.

## \* 安装

`npm i -s @bugsplat/ngx-animated-counter`

## 使用量

添加数据 `NgxAnimatedCounterModule` 到您的模块的导入 :

```ts
import { NgxAnimatedCounterModule } from '@bugsplat/ngx-animated-counter'

@NgModule({
  ...
  imports: [
    NgxAnimatedCounterModule
  ],
  ...
})
```

这个 `ngx-animated-counter` 组件需要一个输入属性 `start` (数字是动画), `end` (数字结束动画), `interval` (增量之间以毫秒计),以及 `increment` (每个间隔递增的次数):

```ts
public params: NgxAnimatedCounterParams = { start: 20, end: 220, interval: 10, increment: 20 };
```

在组件模板中添加计数器 :

```html
<ngx-animated-counter [params]="params"></ngx-animated-counter>
```

## 关于

[纳克思活化计数器](https://github.com/BugSplat-Git/ngx-animated-counter) 是一个开源工具,来自 [BugSpla](https://www.bugsplat.com/)! BugSplat 是开发者在使用时用于查找其软件崩溃时的崩溃和错误报告工具,并用于收集修复这些错误的宝贵数据。 如果你对错误报告感兴趣, 请检查我们 [角质](https://docs.bugsplat.com/introduction/getting-started/integrations/web/angular) 一体化.

与:心脏:  
BugSpla

## 常见问题

### 如何安装 @bugsplat/ngx-animated-counter？

在项目目录运行 npm install @bugsplat/ngx-animated-counter，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：@angular/common（\>=6\.0\.0）、@angular/core（\>=6\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @bugsplat/ngx-animated-counter 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @bugsplat/ngx-animated-counter 支持 ESM 还是 CommonJS？

以 ES Module 形式发布，推荐使用 import 引入。在 CommonJS 项目中，Node\.js 20\.19\+ / 22\.12\+ 可以直接 require\(\) 不含顶层 await 的 ES Module，更早的版本需要改用动态 import\(\)。

### @bugsplat/ngx-animated-counter 可以商用吗？

@bugsplat/ngx-animated-counter 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @bugsplat/ngx-animated-counter 的下载量有多少？

根据 npm 官方下载统计，@bugsplat/ngx-animated-counter 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,282 次，日均约 76 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @bugsplat/ngx-animated-counter 还在维护吗？

最新版本 18\.0\.0 发布于 2024/07/19（2 年前）；至今共发布 4 个版本，其中过去 12 个月发布了 0 个；首次发布于 2022/02/11。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

