当我从'ng2-orm'导入Config时,为什么我的ng2-orm包不被导入(或被vscode识别);
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { Config } from 'ng2-orm'; // ng2-orm/Config won't work either
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
Run Code Online (Sandbox Code Playgroud)
我正在努力构建我自己的TS库,用于angular2和ionic2.我已经研究和搜索,似乎无法想出为什么这是失败的,这可能只是由于我的某种不完整性.
我知道这只是一个开始,但我认为从项目内部导出的任何东西都应该是可访问的.我需要一个ngModule定义吗?
我提供了package.json,一些文件夹结构,gulp(所以你可以看到它)和tsconfig.json
一切都很精细等等.
但是,当我在角度快速启动时安装它时,它表示当我尝试导入时无法找到ng2-orm.我将所有内容都装入了index.js,并且该软件包位于node_modules文件夹中.
我错过了systemjs.config.js需要的东西吗?我不确定.我有一个typings.json,但它基本上是空的,也许我错过了那里的东西?
export * from './Config/Config';
Run Code Online (Sandbox Code Playgroud)
export class Config {
public test(): boolean { return true; }
}
Run Code Online (Sandbox Code Playgroud)
index.d.ts
export * …Run Code Online (Sandbox Code Playgroud)