Outline - Basic Login Form in Angular 6

March 19, 2019 0 Comments by

Angular App Dev

An outline for implementing a basic login form in Angular 6.

index.html

<app></app>  

main.ts

import { AppModule } from './app/app.module'  

app/app.module.ts

import { NgModule }      from '@angular/core';  
import { AppComponent }  from './app.component';  
import { LoginComponent } from './login';

@NgModule({
  imports: [
​   BrowserModule
  ],
  declarations: [
    AppComponent,
    LoginComponent
  ],
  provider: [
    UserService
  ]
})

export class AppModule {}  

app/login/index.ts

export * from './login.component'  

app/login.component.ts

import { Component, OnInit } from '@angular/core';

@Component({
  templateUrl: 'login.component.html'
})

export class LoginComponent implements OnInit {  
  constructor(){}
  ngOnInit(){}
  onSubmit(){}
}

Tag cloud