Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

371
Visualizações
Angular 4.1.0 in Plunker: adding component returns 404 XHR Error

I'm trying to use Angular 4 with Plunker and I can't manage to add a new component. The URL is: https://plnkr.co/edit/1umcXTeug2o6eiZ89rLl?p=preview

I've just created a new component - mycomponent.ts - with the minimum of declarations. Then, in app.ts, I'm adding the importing declaration:

import {MyComponent} from "./mycomponent";

and add the component in the declarations array within the @NgModule decorator:

 declarations: [ App, MyComponent ],

This last bit breaks it and returns a 404 XHR error. So far I just played with changing the import declaration ("./" or not), inline/URL template for the component template, chrome/firefox browsers but nothing works so far. I'm inclined to think it's Plunker's fault :S

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Change the name of mycomponent.ts to src/mycomponent.ts and it will work.

The error is because it can't include the component (bad pathing).

Don't forget to add <combo-compo></combo-compo> to your app.ts template.

Check it out:

enter image description here

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda