<file_sep>import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginFormComponent } from './login-form/login-form.component';
import { LoginRegisterComponent } from './login-register/login-register.component';
import { LoginForgotPasswordComponent } from './login-forgot-password/login-forgot-password.component';
import { LoginVerifyEmailComponent } from './login-verify-email/login-verify-email.component';


const routes: Routes = [
  { path: '', component: LoginFormComponent },
  { path: 'registrar', component:  LoginRegisterComponent },
  { path: 'esqueci-senha', component:  LoginForgotPasswordComponent },
  { path: 'verifica-email', component:  LoginVerifyEmailComponent }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class LoginRoutingModule { }
<file_sep>import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { ProjectListComponent } from './project-list/project-list.component';
import { ProjectFormComponent } from './project-form/project-form.component';
import { ProjectComponent } from './project/project.component';
import { ProjectFaseFormComponent } from './project-fase-form/project-fase-form.component';
import { ProjectFaseListComponent } from './project-fase-list/project-fase-list.component';
import { ProjectFaseComponent } from './project-fase/project-fase.component';

const routes: Routes = [
  // Lista de Projetos
  { path: '', component: ProjectListComponent },
  // Cadastrar Projeto
  { path: 'cadastrar-projeto', component: ProjectFormComponent },
  // Mostrar Projeto
  { path: ':id_projeto', component: ProjectComponent },
  // Editar Projeto
  { path: ':id_projeto/editar', component: ProjectFormComponent },
  // Cadastrar Fase do Projeto
  { path: ':id_projeto/cadastrar-fase', component: ProjectFaseFormComponent },
  // Mostrar Fases do Projeto
  { path: ':id_projeto/fases', component: ProjectFaseListComponent },
  // Mostrar Fase do Projeto
  { path: ':id_projeto/:numero_fase', component: ProjectFaseComponent },
  // Editar Fase do Projeto
  { path: ':id_projeto/:numero_fase/editar', component: ProjectFaseFormComponent },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class ProjectsRoutingModule { }
<file_sep>import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { ProjectFaseFormComponent } from './project-fase-form.component';

describe('ProjectFaseFormComponent', () => {
  let component: ProjectFaseFormComponent;
  let fixture: ComponentFixture<ProjectFaseFormComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ ProjectFaseFormComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(ProjectFaseFormComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});
<file_sep>import { Component, OnInit } from '@angular/core';
import { AuthService } from '../auth/auth.service';
import { Router } from '@angular/router';

@Component({
  selector: 'app-login-form',
  templateUrl: './login-form.component.html',
  styleUrls: ['./login-form.component.css']
})
export class LoginFormComponent implements OnInit {

  constructor(
    private authService: AuthService,
    private router: Router) { }

  img: string;

  ngOnInit() {
    const user = localStorage.getItem('user');
    console.log(user);
    if (user) {
      this.router.navigate(['/projetos']);
    }
    this.img = `./../assets/images/brq-digital-solutions.png`;
  }

  login(email: string, senha: string) {
    const loginUser = this.authService.login(email, senha).then(
      data => {
        console.log(data);
        this.router.navigate(['/projetos']);
      },
      error => {
        console.error(error);
      }
    );
    console.log(loginUser);
  }

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

@Component({
  selector: 'app-project-fase-list',
  templateUrl: './project-fase-list.component.html',
  styleUrls: ['./project-fase-list.component.css']
})
export class ProjectFaseListComponent implements OnInit {

  constructor() { }

  ngOnInit() {
  }

}
<file_sep>import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { LoginRoutingModule } from './login-routing.module';
import { LoginFormComponent } from './login-form/login-form.component';

import { LoginRegisterComponent } from './login-register/login-register.component';
import { LoginForgotPasswordComponent } from './login-forgot-password/login-forgot-password.component';
import { LoginVerifyEmailComponent } from './login-verify-email/login-verify-email.component';

@NgModule({
  declarations: [LoginFormComponent, LoginRegisterComponent, LoginForgotPasswordComponent, LoginVerifyEmailComponent],
  imports: [
    CommonModule,
    LoginRoutingModule
  ]
})
export class LoginModule { }
<file_sep>import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-project-fase-form',
  templateUrl: './project-fase-form.component.html',
  styleUrls: ['./project-fase-form.component.css']
})
export class ProjectFaseFormComponent implements OnInit {

  id_fase: string;
  url: string;

  constructor(private router: Router) {}

  ngOnInit() {
    this.id_fase = this.router.url.replace('/projetos/', '');
    this.url = this.id_fase.replace('/cadastrar-fase', '');
  }

}
<file_sep>import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { ProjectsRoutingModule } from './projects-routing.module';
import { ProjectFormComponent } from './project-form/project-form.component';
import { ProjectListComponent } from './project-list/project-list.component';
import { MenuComponent } from '../../components/menu/menu.component';
import { ProjectComponent } from './project/project.component';
import { ProjectFaseFormComponent } from './project-fase-form/project-fase-form.component';
import { ProjectFaseListComponent } from './project-fase-list/project-fase-list.component';
import { ProjectFaseComponent } from './project-fase/project-fase.component';

@NgModule({
  declarations: [
    ProjectListComponent,
    ProjectFormComponent,
    MenuComponent,
    ProjectComponent,
    ProjectFaseFormComponent,
    ProjectFaseListComponent,
    ProjectFaseComponent
  ],
  imports: [
    CommonModule,
    ProjectsRoutingModule
  ]
})
export class ProjectsModule { }
<file_sep>import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

@Component({
  selector: 'app-project',
  templateUrl: './project.component.html',
  styleUrls: ['./project.component.css']
})
export class ProjectComponent implements OnInit {

  url: string;
  novaFase: string;

  constructor(private router: Router) {}

  ngOnInit() {
    this.url = this.router.url.replace('/projetos/', '');
    this.novaFase = this.router.url + '/cadastrar-fase';
  }

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

@Component({
  selector: 'app-menu',
  templateUrl: './menu.component.html',
  styleUrls: ['./menu.component.css']
})
export class MenuComponent implements OnInit {

  img: string;

  constructor() { }

  ngOnInit() {
    this.img = `./../assets/images/brq-digital-solutions.png`;
  }

}
