I'm new to angular2, I'm trying to use two components on the same page, but it gives me 404 error.
these are my two files .ts
app.ts
import {Component, View, bootstrap} from 'angular2/angular2';
import {events} from './event.component';
@Component(
{
selector: 'contact'
})
@View({
templateUrl: './Travel Operator/login.html',
directives: [events]
})
export class Contact {
}
bootstrap(Contact);
and event.component.ts
import {Component, View, bootstrap} from "angular2/angular2";
@Component(
{
selector: 'events'
})
@View({
template: '<h1>Hello World</h1>'
})
export class events {
}
}
bootstrap(events);
and I'm trying to use it in my main index.html file like
<html>
<body>
<h1>First Angular App</h1>
<div id="content">
<contact></contact>
</div>
<div id="events">
<events></events>
</div>
</body>
</html>
but he gives
"NetworkError: 404 Not Found - http: // localhost: 55777 / event.component " error
I'm stuck there please help
source
share