Keep in mind: To launch the Angular2 App.
At least one module and component is required.Do I need app.component.ts?
Not required . This is simply the name of the .ts file . It can be any other component. But, as said, at least one module and component must initiate the Angular2 App.
Understand below
main.ts
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
app.module.ts// .ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { SomeComponent } from './some.component';
@NgModule({
imports: [ BrowserModule],
declarations: [ SomeComponent ],
bootstrap: [ SomeComponent ]
})
export class AppModule { }
some.component.ts// .ts
import { Component } from '@angular/core';
import {UserService} from '../shared/shared.service';
@Component({
selector: 'my-app', //<<<===make sure this matches with custom HTML tag used in index.html
template: `<h1>Anglar2</h1>
`
})
export class SomeComponent {}