Hussein Samao
Hussein Samao

Reputation: 53

Angular2 - 404 GET /app/app.component.js

I downloaded Angular2 Quick Start from GitHub enter link description here. I moved all configuration files to config directory to keep my project organized. therefore; I ran into an issue "404 GET /app/app.component.js" as shown below.

So, my project looks like:

# Sample of output

16.06.25 19:08:55 304 GET /main.js 16.06.25 19:08:55 304 GET /node_modules/@angular/platform-browser-dynamic//bundles/platform-browser-dynamic.umd.js 16.06.25 19:08:55 404 GET /app/app.component.js 16.06.25 19:08:55 304 GET /node_modules/@angular/common//bundles/common.umd.js 1 16.06.25 19:08:55 304 GET /node_modules/@angular/compiler//bundles/compiler.umd.js 16.06.25 19:08:55 304 GET /node_modules/@angular/core//bundles/core.umd.js 16.06.25 19:08:55 304 GET /node_modules/@angular/platform-browser//bundles/platform-browser.umd.js

# Main.ts

import {bootstrap}    from '@angular/platform-browser-dynamic';
import {AppComponent} from "app.component";

bootstrap(AppComponent);

# app.component.ts

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

@Component({
    selector: 'my-app',
    template: '<h1>My First Angular 2 App</h1>'
})
export class AppComponent { }

Upvotes: 0

Views: 514

Answers (1)

Sudheer KB
Sudheer KB

Reputation: 1606

This can be solved by changing import {AppComponent} from "app.component";
to

import {AppComponent} from "./app.component";

Upvotes: 0

Related Questions