Skip to content

Instantly share code, notes, and snippets.

@n8rzz
Created October 18, 2021 05:01
Show Gist options
  • Save n8rzz/ec92e19eb20ecd0b44ea84d37fd4ff37 to your computer and use it in GitHub Desktop.
Save n8rzz/ec92e19eb20ecd0b44ea84d37fd4ff37 to your computer and use it in GitHub Desktop.
Student.collection.ts
import { StudentModel } from "./Student.model";
export class StudentCollection {
private _items: StudentModel[] = [];
get length(): number {
return this._items.length;
}
public addItems(itemsToAdd: StudentModel[]): void {
itemsToAdd.forEach((item: StudentModel) => {
this._items.push(item);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment