January 2018
Intermediate to advanced
332 pages
7h 36m
English
Let's now create the trie tree, which we will be using within our application. Within our application, let's first create the directory called utils under the src folder in which we will be adding our trie.ts file.
The API for our tree will be quite concise with only two methods:
import {Injectable} from "@angular/core";@Injectable()export class Trie { tree: any = {}; constructor() {}}
Once created, let's inject it into the list of providers in our main module listed in app.module.ts so that our components have access to the tree, as follows:
import { BrowserModule } from '@angular/platform-browser' ...
Read now
Unlock full access