Plunker link: Click here to view the Plunker
https://i.sstatic.net/QXZDv.png
Resource Directory:
https://i.sstatic.net/yS423.png
app.ts File Content:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { routes } from './app.routing';
import { AppComponent } from './app.component';
// import { LoginComponent } from './login/login.component';
// import { AuthService } from './shared/services/auth.service';
@NgModule({
imports: [
BrowserModule,
FormsModule,
RouterModule.forRoot(routes)
],
declarations: [
AppComponent,
// LoginComponent
],
providers: [
// AuthService,
],
bootstrap: [ AppComponent ]
})
export class AppModule {}
app.component File Content:
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
ngOnInit() {
console.log('oninit')
}
}