October 2017
Intermediate to advanced
280 pages
6h 50m
English
In order to make the tooltip directive available to the Angular's compiler, we will need to explicitly declare where we intend to use it. For instance, take a look at the AppModule class at ch5/tooltip/app.ts:
@NgModule({
declarations: [Tooltip, App],
providers: [Overlay],
imports: [BrowserModule],
bootstrap: [App],
})
class AppModule {}
To the @NgModule decorator, we pass an object literal that has the declarations property. This property contains a list of all the directives that will be available in all component subtrees with roots of any of the components listed in the bootstrap array. Another way to extend the list of available directives is to import a module. For instance, the BrowserModule ...
Read now
Unlock full access