- Remove all code from
app.component.htmlexcept<router-outlet></router-outlet>and wrap it into<app-nav>. - Add an input and a button to add new todos in the app component template
app.component.html. - Add an
addmethod toapp.component.ts - Add
<ng-content></ng-content>at the placeholder location innav.component.html. - Run
ng build --prod. - In a new terminal window switch to the
my-pwa/dist/my-pwa/folder and executenpx lite-server. A browser window with your application should now open with url http://localhost:3000
Last active
February 28, 2020 11:47
-
-
Save SteffenJahr/8d39699121f259569717a7e465dfd51c to your computer and use it in GitHub Desktop.
PWA-Workshop Lab #6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <app-nav> | |
| <input type="text" #input /><button (click)="add(input.value)">Hinzufügen</button> | |
| <router-outlet></router-outlet> | |
| </app-nav> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@angular/core'; | |
| @Component({ | |
| selector: 'app-root', | |
| templateUrl: './app.component.html', | |
| styleUrls: ['./app.component.scss'], | |
| }) | |
| export class AppComponent { | |
| title = 'my-pwa'; | |
| add(value: string) { | |
| console.log(value); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment