とビング・コンポーネントを読み取ることができません、それは文句を言わない私にはまったくマップをレンダリングしてみましょう:は角4で財産ヌルビングマップの「原型」とAngualar4
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Microsoft</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<script type='text/javascript' src='http://www.bing.com/api/maps/mapcontrol?branch=experimental'></script>
</head>
<body onload="AppComponent.helloWorld()">
<div id="myMap"></div>
<app-root></app-root>
</body>
</html>
これは私のコンポーネントである:
export class AppComponent implements OnInit {
@ViewChild('myMap') myMap;
title = 'app';
ngOnInit() {
if(Microsoft !== undefined){
var map = new Microsoft.Maps.Map(this.myMap.nativeElement, {
credentials: 'key goes here'
});
}}
}
コンポーネントHTMLファイル:
<div #myMap style='width: 100%; height: 500px;'></div>
私は何が間違っているのか分かりません。しかし、私はロードするマップを取得することはできません。それは投げているのは、nullエラーのプロパティ 'プロトタイプ'を読み取ることができません。
私は何をインポートする必要があるのか教えていただけますか? – Vega