getTags()
Description
Gets a promise with an array of default tags
info
The getTags() method is a part of the RestDataProvider service intended for working with a server
Usage
getTags(): Promise<string[]>;
Response
The getTags() method sends a request to the server by the GET method and returns a promise with the list of tags which are set by default.
Example
const { ToDo, Toolbar, RestDataProvider } = todo;
const activeProject = null;
const url = "http://localhost:3000";
const restProvider = new RestDataProvider(url);
Promise.all([
restProvider.getProjectTasks(activeProject),
restProvider.getProjects(),
restProvider.getTags(),
]).then(([tasks, projects, tags]) => {
const list = new ToDo("#root", {
tasks,
projects,
tags,
activeProject,
});
const toolbar = new Toolbar("#toolbar", {
api: list.api,
});
list.api.setNext(restProvider);
restProvider.setAPI(list.api);
});
Related articles: Working with Server