Okei Okei - 5 months ago 980
Javascript Question

Angular 2 Module has no exported member

Here I am again, hoping to find a quick solution to this:

Link <- Click on this link to see the folder structure

//main.ts
import {bootstrap} from 'angular2/platform/browser';
import {AppComponent} from './home.main';
import {InputComponent} from './home.controller';
import {enableProdMode} from 'angular2/core';


bootstrap(InputComponent);
bootstrap(AppComponent);


This is my main.ts file where I import the AppComponent from home main, now the home.main looks like this:

import {Component} from 'angular2/core';

@Component({
selector:'home',
templateUrl:'/index/index.ejs'
})

export class InputComponent {
name = 'test';
}


However, when I run this, I get:
error TS2305: Module '"controllers/home/home.main"' has no exported member 'AppComponent'. ( Same goes for home.controller ).


Thank you,
Alex S.

Answer

You should have something like that in your home.main module:

@Component({
  (...)
})
export class AppComponent {
}