Creates an instance of the SnippetService.
The data access object used for loading and saving snippets.
Adds an existing snippet to the appropriate parent in the snippet collection.
If the parent ID is root, the snippet is added to the root's children.
Otherwise, the snippet is added to the parent identified by the parentId
.
The snippet to add.
Static
findRecursively searches for the parent snippet by its ID in the given snippet tree.
The ID of the parent snippet to find.
The current snippet being examined.
The parent snippet if found, otherwise undefined.
Static
flatten
Service for managing snippets and interacting with data access.