ngx-easy-d3
Version:
Build an Angular library compatible with AoT compilation and Tree shaking like an official package
23 lines (18 loc) • 404 B
text/typescript
import { Injectable } from '@angular/core';
export class SumService {
/**
* Stores the last sum.
*/
public sum: number;
/**
* Calculates the sum.
* @param addends Numbers to be added
*/
public calculate(...addends: number[]): void {
this.sum = 0;
for (const addend of addends) {
this.sum += addend;
}
}
}