Okei Okei - 1 year ago 1946
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

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


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';


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 Source

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

export class AppComponent {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download