【发布时间】:2016-08-29 14:32:27
【问题描述】:
我在我的 html 模板中使用这样的东西:
<div class="input-group" id="geo-type">
<div class="input-label" [style.color]="geographicLocationColor">{{geoLocationTitle}}</div>
<select class="dropdown-toggle dropdown-select" role="button" aria-haspopup="true" aria-expanded="false">
<option value="" selected hidden>{{geographicLocationPl}}</option>
<option *ngFor="#geo of geographicLocations" (click)="locationOnSelect(geo)">{{geo.description}}</option>
</select>
</div>
如果我使用 firefox 在下拉菜单中选择某些内容,则会调用方法 locationOnSelect(我正在执行其他一些由位置标识的 GET),但在 Chrome 中不会发生任何事情 - 方法 locationOnSelect 没有被调用。
我的 IE(版本 11)也有问题,locationOnSelect 没问题,但在下一个 GET(用户在第二个下拉菜单中选择某些内容)时,IE 崩溃 - 停止工作。所以我的应用程序 100% 只在 Firefox 中工作。有什么想法吗?
【问题讨论】:
-
我在 select 属性上看不到
(click)指令。添加并检查。 -
我将我的 (click)="locationOnSelect(geo)" 移动到选择标签,现在,应用程序崩溃,因为地理未定义。
标签: html twitter-bootstrap angular