TMF Tag Firestore SDK
npm install --save @inclouded/tmf-tags
Introduction
In the repository the Firebase Cloud Firestore SDK can be found that was made for the TMF Tag resource in an installable Angular folder form. The SDK can be installed for every Angular 2+ project. The SDK accomplishes the necessary CRUD operations.
Usage
-
For using the SDK an Angular 2+ project is needed, in which we can establish a connection to a Firestore database instance. (configured in environments.ts)
-
The SDK can be used in a Service in the following way:
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { AngularFirestore } from '@angular/fire/firestore';
import { TagsApi } from '@inclouded/tmf-tags'
@Injectable()
export class TagsService {
TagsApi: TagsApi;
constructor(private afs: AngularFirestore) {
this.TagsApi = new TagsApi(this.afs);
}
addTag(tag: any, id?: string) {
return this.TagsApi.add(tag, id);
}
getAllTags() {
return this.TagsApi.getAll();
}
deleteTag(tagId: string) {
return this.TagsApi.delete(tagId);
}
updateTag(tag: any) {
return this.TagsApi.update(tag);
}
getTagById(id: string) {
return this.TagsApi.getById(id);
}
getTagsByRelatedParty(relatedParty: string, orderBy?: OrderBy, paging?: Paging) {
return this.TagsApi.getTagsByRelatedParty(relatedParty);
}
getTagsByResourceSpecCharacteristic(resourceSpecCharacteristic: string, orderBy?: OrderBy, paging?: Paging) {
return this.TagsApi.getTagsByResourceSpecCharacteristic(resourceSpecCharacteristic);
}
getTagsByNameSubStr(nameSubStr: string, orderBy?: OrderBy, paging?: Paging) {
return this.TagsApi.getTagsByNameSubStr(nameSubStr);
}
}
Developer: Zoltán R. Jánki (jankiz@inf.u-szeged.hu), Gábor Simon (simonovszkij@gmail.com)