February 2019
Intermediate to advanced
446 pages
10h 55m
English
The root component provides the structure to the app. Here, we have added header, content, and footer areas. The content area is marked with router-outlet. The router outlet allows for the dynamic binding of components with respect to route change.
It also uses the ngIf Angular directive. ngIf takes the predicate and allows for the rendering of the element, but only if the predicate returns true. Therefore, when the user is logged in, it will show Welcome Username! with a logout button. Otherwise, it will show only a login button:
<div id="container"> <!-- BEGIN HEADER --> <nav class="navbar navbar-expand-lg navbar-dark bg-dark" role="navigation"> <a class="navbar-brand" href="#"> Online ...
Read now
Unlock full access