Open web-dave opened 2 years ago
ng g component top-nav
src
Angular Generator
Component
top-nav
AppModule
declarations
Finde src/app/app.component.html ersetzte alles durch
src/app/app.component.html
<app-top-nav></app-top-nav> <router-outlet></router-outlet>
<div class="topnav"> <a href="#films">films</a> <a href="#people">people</a> <a href="#planets">planets</a> <a href="#species">species</a> <a href="#starships">starships</a> <a href="#vehicles">vehicles</a> </div>
app-top-nav { .topnav { background-color: #333; overflow: hidden; a { float: left; color: #f2f2f2; text-align: center; padding: 14px 16px; text-decoration: none; font-size: 17px; &:hover { background-color: #ddd; color: black; } &.active { background-color: #04aa6d; color: white; } } } }
Next
Generiere eine neue Angular Component.
Lokal
Online
src
Ordner in der Projekt Section.Angular Generator
Component
auswählentop-nav
im Promt eingeben und bestätigenAppModule
indeclarations
array eintragenComponent einbinden
Finde
src/app/app.component.html
ersetzte alles durchsetup TopNav
top-nav.component.html
src/styles.scss