agm时髦的信息窗口样式没有改变

时间:2018-03-28 15:50:28

标签: angular infowindow angular-google-maps

我正在尝试自定义当我点击标记时会出现的AgmSnazzyInfoWindow。

在我的HTML文件中,我有以下代码,

<agm-snazzy-info-window [maxWidth]="800" [closeWhenOthersOpen]="true" [backgroundColor]="orange">
          <ng-template>
            <mat-card>{{ pLocationId }}  {{ pLocationName }}</mat-card>
            <mat-nav-list>
                <mat-list-item>
                </mat-list-item>
              </mat-nav-list>
          </ng-template>
        </agm-snazzy-info-window>

根据属性,信息的背景颜色应为橙色,但我没有得到预期的结果。

这是我得到的信息窗口,

enter image description here

背景颜色不是橙色。 请纠正我在哪里出错。

1 个答案:

答案 0 :(得分:1)

尝试编写不带括号的backgroundColor输入。如果编写它们,则angular会从控制器中查找变量/函数,而不是获取文字值。

以下代码应该起作用:

<agm-snazzy-info-window [maxWidth]="800" [closeWhenOthersOpen]="true" backgroundColor="orange">
  <ng-template>
    <mat-card>{{ pLocationId }}  {{ pLocationName }}</mat-card>
      <mat-nav-list>
        <mat-list-item>
        </mat-list-item>
      </mat-nav-list>
   </ng-template>
 </agm-snazzy-info-window>