0
私は、私のangular2アプリケーションでGoogleマップのような単純なマップが本当に必要なホームページで作業していました。地図が必要な場所は何も表示されません。確かに私は何かが欠けているだけです。AngularJs2 - ng2-mapが動作しない/上に表示される
の下では、私のSystem.config
<!-- Configure SystemJS -->
<script>
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
},
'ng2-map': {
main: 'index.js',
defaultExtension: 'js'
}
},
map: {
'ng2-map': 'node_modules/ng2-map'
}
});
System.import('app/js/main').then(null, console.error.bind(console));
</script>
され、その後、MAPディレクティブを使用しようとしているコンポーネントがあります。
import { NG2_MAP_DIRECTIVES } from "ng2-map";
@Component({
selector: 'contact',
templateUrl: '../../../html/contact.html',
directives: [NG2_MAP_DIRECTIVES]
})
そして最後にHTML部分:
<div class="ContentRow-Paralax" id="secondAbout">
<div class="topstripe">
</div>
<div class="stripe">
<h2>Trollolol</h2>
</div>
<div class="ContentRow-Paralax">
<ng2-map id="map" [center]="[40.74, -74.18]" default-style="false"></ng2-map>
は上に行くと思う、と私に教えてエラー・ログがありません他の多くはありません私は間違っていた。あなたが私を助けてくれることを願っています! =)