사용시에는 다음과 같은 코드 ...'module'이름을 찾을 수 없습니다. commonjs
@Component({
module: module.id,
selector: 'hero',
templateUrl:'hero.component.html',
styleUrls: ['hero.component.css'],
directives: [HeroDetailComponent, MD_CARD_DIRECTIVES, MD_BUTTON_DIRECTIVES, MD_LIST_DIRECTIVES, MD_ICON_DIRECTIVES, MdToolbar, MD_INPUT_DIRECTIVES],
providers: [HeroService],
viewProviders: [MdIconRegistry]
})
export class HeroComponent implements OnInit{
...
}
//tsconfig.js
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"rootDir": "src/ng2",
"moduleResolution": "node",
"sourceMap": false,
"inlineSources": true,
"inlineSourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"outDir": "public/ng2",
"noImplicitAny": false
},
"exclude": [
"node_modules",
"typings/main",
"typings/main.d.ts"
]
}
하지만 실행할 때 내가 좀 ..
SRC/NG2/구성 요소/영웅/hero.component.ts (15 , 13) : 오류 TS2304 : '모듈'이름을 찾을 수 없습니다.
UPDATE
나는, 알려진 속성을 지정할 수 있습니다 ... this question
"globalDependencies": {
"node": "registry:dt/node#6.0.0+20160608110640"
}
하지만 여전히 볼 수에 따라 단계를 수행하는
객체 리터럴을 시도 및 '모듈'유형에 존재하지 않습니다
(210)
업데이트 2 부트 스트랩 파일을 업데이트 한 후 나는 아직도
SRC/NG2/구성 요소/영웅/hero.component.ts를 참조
import {bootstrap} from '@angular/platform-browser-dynamic'; import {HeroComponent} from './components/hero/hero.component'; import { HTTP_PROVIDERS } from '@angular/http'; declare var module:any; bootstrap(HeroComponent, [ HTTP_PROVIDERS ]);
... 같이하는 (15,5) : 오류 TS2345 : '{module : string; 선택자 : 문자열; 템플릿 : 문자열; styleUrls : 문자열 []; 지시어 : (typeof He ... '는'{selector ?: string; inputs ?: string []; type? : string []; properties ?: 문자열 []; events ?: strin ..의 매개 변수에 할당 할 수 없습니다. ' 객체 리터럴은 알려진 속성 만 지정할 수 있으며'module '은 유형'{selector ?: string; inputs ?: string [];은 ?: 문자열 []; 속성 ?: 문자열 []; ? :. strin ... '여기
는 project
시도했지만 여전히 문제가있는 것 같습니다. 어떤 아이디어? 업데이트 – Jackie
수정 된 답변 체크 아웃을 참조하십시오. 어쩌면 선은 타이프 스크립트 정의 파일에 있어야 할 것입니다. – BeetleJuice
나는 아직도 그것을 내 transpiler로 systemJS를 사용할 수 있습니까? – Jackie