This code snippet is functioning properly in a project built with angular2 RC4
import * as mapTypes from '../../../../node_modules/angular2-google-maps/core/services/google-maps-types.d.ts';
What could be causing this issue?
Now, when attempting to use the same line of code in a new seed file with RC6, an error is thrown:
error TS2691: An import path cannot end with a '.d.ts' extension. Consider importing '../../../../node_modules/angular2-google-maps/core/services/google-maps-types' instead.
However, if I make the suggested modification, I encounter:
Cannot find module '../../../../node_modules/angular2-google-maps/core/services/google-maps-types'
The contents of the .d.ts
file are as follows:
/**
* angular2-google-maps - Angular 2 components for Google Maps
* @version v0.12.0
* @link https://github.com/SebastianM/angular2-google-maps#readme
* @license MIT
*/
export declare var google: any;
export interface GoogleMap {
constructor(el: HTMLElement, opts?: MapOptions): void;
panTo(latLng: LatLng | LatLngLiteral): void;
setZoom(zoom: number): void;
addListener(eventName: string, fn: Function): void;
getCenter(): LatLng;
setCenter(latLng: LatLng | LatLngLiteral): void;
getBounds(): LatLngBounds;
getZoom(): number;
setOptions(options: MapOptions): void;
}
...
and the corresponding .ts
file looks like this:
/**
* angular2-google-maps - Angular 2 components for Google Maps
* @version v0.12.0
* @link https://github.com/SebastianM/angular2-google-maps#readme
* @license MIT
*/
"use strict";
//# sourceMappingURL=google-maps-types.js.map
NOTE: Although there is a newer version of this package designed for RC6, I am determined to make this current version compile successfully in TypeScript