Tôi có dự án góc-clinguyên cảo Lỗi: Không thể tìm thấy không gian tên 'google'
~ gốc ~/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"
}
}
~ gốc ~/typings/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" />
~ gốc ~/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"
]
}
}
Sau khi chạy ng phục vụ Tôi có thông báo lỗi trong giao diện điều khiển
ERROR in [default] F:~root~\src\app\ui\google-map\map-marker\map-marker.directive.ts:7:26
Cannot find namespace 'google'
và
ERROR in [default] ~root~\src\app\trip-entry-page\trip-entry-page.component.ts:188:21
Cannot find name 'google'
~ gốc ~ \ src \ ứng dụng \ ui \ google-map \ bản đồ -marker \ map-marker.directive.ts: 7: 26
...
@Input() veyoMapMarker: google.maps.MarkerOptions
...
~ gốc ~ \ src \ ứng dụng \ trip-entry-page \ trip-entry-page.component.ts: 188: 21
...
if (status === google.maps.DirectionsStatus.OK) {
...
Sau khi xây dựng ứng dụng đúng làm việc
thế nào tôi giải quyết thông báo lỗi này?
Bạn đã tìm thấy một giải pháp cho vấn đề này? Tôi đang gặp vấn đề tương tự. –
Câu trả lời dưới đây có giúp ích cho bạn không? Nếu vậy bạn có thể đánh dấu nó là câu trả lời được chấp nhận để người khác có thể tìm thấy nó. –
Vui lòng tham khảo câu trả lời của tôi ở đây: http://stackoverflow.com/a/42733315/1087131 Tôi đang sử dụng CLI RC0. –