我正在尝试将应用程序从RC4升级到RC7,我在src / app文件夹中创建了一个app.module.ts。
my /**
* This is a hack to get at the protected {@link WireFeedInput#createSAXBuilder()} method so we can get the
* raw jdom document for the feed to extract elements (e.g. 'image') not parsed by the built in feed parsers.
*/
public class MyWireFeedInput extends WireFeedInput {
Document getDocument(Reader reader) {
final SAXBuilder saxBuilder = createSAXBuilder();
try {
if (xmlHealerOn) reader = new XmlFixerReader(reader)
return saxBuilder.build(reader);
} catch (final JDOMParseException ex) {
throw new ParsingFeedException("Invalid XML: " + ex.getMessage(), ex);
} catch (final IllegalArgumentException ex) {
throw ex;
} catch (final Exception ex) {
throw new ParsingFeedException("Invalid XML", ex);
}
}
}
文件夹中的main.ts包含以下行:
src
返回以下错误:
import { AppModule } from './app/';
为什么我收到此错误?我和另一个有效的项目做了同样的事情。
我的app.module.ts
WARNING in ./src/main.ts
9:41 export 'AppModule' was not found in './app/'
ERROR in [default] c:\xampp\htdocs\newPROJECT\src\main.ts:6:9
Module '"c:/xampp/htdocs/newPROJECT/src/app/index"' has no exported member 'AppModule'.
答案 0 :(得分:1)
您必须在index.ts
文件夹中创建app
才能导出AppModule
:
// index.ts
export * from './app.module';
或者您可以在AppModule
中导入main.ts
,如下所示:
import { AppModule } from './app/app.module';