2
respostas

Rapaz estou com um pequeno problema, devo ter me perdido no projeto e gostaria de saber no que errei.

quando estou fzendo a parte do router module e tento utilizar o localhost:4200/usar/flavio o navegador me retorna isso.

http://http://localhost:4200/user/flavio http://localhost:4200/p/add

2 respostas

Fala aí André, tudo bem? Desculpe mas não entendi a dúvida/problema, consegue passar mais detalhes?

Fico no aguardo.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { PhotoComponent } from './photos/photo/photo.component';
import { PhotosModule } from './photos/photos.module';
import { AppRoutingModule } from './app.routing.module';


@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    PhotosModule,
    AppRoutingModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core';

import { AppComponent } from './app.component'; import { PhotoComponent } from './photos/photo/photo.component'; import { PhotosModule } from './photos/photos.module'; import { AppRoutingModule } from './app.routing.module';

@NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, PhotosModule, AppRoutingModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }

import { NgModule } from '@angular/core';
import { HttpClientModule } from '@angular/common/http';
import { CommonModule } from '@angular/common';
import { PhotoFormComponent } from './photo-form/photo-form.component';
import { PhotoListComponent } from './photo-list/photo-list.component';
import { PhotoComponent } from './photo/photo.component';

//imports dos componentes PhotoComponent e PhotoListComponent

@NgModule({
    declarations: [
        PhotoComponent,
        PhotoListComponent,
        PhotoFormComponent
    ],
    imports: [
        HttpClientModule,
        CommonModule
    ]
})
export class PhotosModule {}

import { NgModule } from '@angular/core'; import { HttpClientModule } from '@angular/common/http'; import { CommonModule } from '@angular/common'; import { PhotoFormComponent } from './photo-form/photo-form.component'; import { PhotoListComponent } from './photo-list/photo-list.component'; import { PhotoComponent } from './photo/photo.component';

//imports dos componentes PhotoComponent e PhotoListComponent

@NgModule({ declarations: [ PhotoComponent, PhotoListComponent, PhotoFormComponent ], imports: [ HttpClientModule, CommonModule ] }) export class PhotosModule {}

por algum motivo quando tento acessar http://localhost:4200/user/flavio me aparece o seguinte erro Cannot GET /user/flavio