Those pesky rebels are planning yet another attack on our death square. Like any good business, we need to prepare by running an inventory on our equipment. Then we can be sure of our impending victory.
-
Open up the
imperial-starfleet
directory in the terminal and start up the app. If you're not sure how to do this, take a look at previous lessons for help. -
Look familiar? This is our "death square," which we'll use to bring doom to the Rebel Alliance. However, we at the Empire demand a little more detail. Try clicking on one of the turrets. Nothing happened, right? Let's fix that.
-
Create a new component called
info-window
so we can see some information about our turrets. -
Create an
app-routing.module.ts
file (just like in the previous lesson) that imports theInfoWindowComponent
and defines one route with the pathinfo
pointing to theInfoWindowComponent
. Import this routing module inapp.module.ts
. -
Add a
router-outlet
toapp.component.html
. -
Test your new route by going to
/info
in your browser. -
That's great, but we need to be able to click a turret and quickly get all its information. Wrap the
img
tag inturret.component.html
in ana
tag with arouterLink
like the one we used in the previous lesson. -
Now, import
RouterModule
in theinternal.defenses.module.ts
file. -
Finally, change the
info-window
component's HTML to sayTurret is functional
.
It's not the most detailed inventory, but it's definitely better than what the rebels have.