我有項目角CLI打字稿錯誤:無法找到命名空間 '谷歌'
〜根〜/ src目錄/ typings.json
{
"globalDevDependencies": {
"angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459",
"jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
"selenium-webdriver": "registry:dt/selenium-webdriver#2.44.0+20160317120654"
},
"globalDependencies": {
"es6-shim": "registry:dt/es6-shim#0.31.2+20160602141504",
"google.maps": "registry:dt/google.maps#3.20.0+20160914131659"
}
}
〜根〜/分型/ index.d .TS
/// <reference path="globals/angular-protractor/index.d.ts" />
/// <reference path="globals/es6-shim/index.d.ts" />
/// <reference path="globals/google.maps/index.d.ts" />
/// <reference path="globals/hammerjs/index.d.ts" />
/// <reference path="globals/jasmine/index.d.ts" />
/// <reference path="globals/selenium-webdriver/index.d.ts" />
〜根〜/ SRC/tsconfig.json
{
"compilerOptions": {
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types",
"../typings"
],
"files": [
"../typings/index.d.ts"
]
}
}
運行納克服務 後我在控制檯
ERROR in [default] F:~root~\src\app\ui\google-map\map-marker\map-marker.directive.ts:7:26
Cannot find namespace 'google'
和
ERROR in [default] ~root~\src\app\trip-entry-page\trip-entry-page.component.ts:188:21
Cannot find name 'google'
〜根〜\ SRC \應用\ UI \谷歌地圖\地圖錯誤消息-marker \ map-marker.directive.ts:7:26
...
@Input() veyoMapMarker: google.maps.MarkerOptions
...
〜根〜\ SRC \程序\跳閘入門頁\跳閘入門page.component.ts:188:21
...
if (status === google.maps.DirectionsStatus.OK) {
...
構建的應用程序正確的工作
後如何我解決這個錯誤消息?
你找到一個解決這個問題?我有同樣的問題。 –
下面的答案對你有幫助嗎?如果是這樣,你可以將其標記爲接受的答案,以便其他人可以找到它。 –
請參閱我的答案:http://stackoverflow.com/a/42733315/1087131 我正在使用CLI RC0。 –