我試圖讓我的Angular 4安裝上的angular-google-maps/@ agm/core工作。爲什麼我得到這個錯誤:由於在Angular 4中添加選擇器標籤時它不是'sebm-google-map'的已知屬性,因此無法綁定到'緯度'?
我有這個在組件的HTML文件:
<sebm-google-map [latitude]="lat" [longitude]="lng">
<sebm-google-map-marker [latitude]="lat" [longitude]="lng"></sebm-google-map-marker>
</sebm-google-map>
當我運行它,我得到這個錯誤消息:
Unhandled Promise rejection: Template parse errors:
Can't bind to 'latitude' since it isn't a known property of 'sebm-google-map'.
1. If 'sebm-google-map' is an Angular component and it has 'latitude' input, then verify that it is part of this module.
2. If 'sebm-google-map' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("<sebm-google-map [ERROR ->][latitude]="lat" [longitude]="lng">
<sebm-google-map-marker [latitude]="lat" [longitude]="lng"></se"): ng:///AppModule/[email protected]:17
謝謝你,男人!它的工作就像一個魅力:) – volna