鍍金池/ 問答/HTML5  Linux  HTML/ angular 項目使用百度地圖 添加標記 點擊事件不觸發(fā)

angular 項目使用百度地圖 添加標記 點擊事件不觸發(fā)

百度地圖官方實例

在地圖上添加標記,自定義標記信息窗口,如下:

 var html = [];
        html.push('<span style="font-size:12px">添加標記: </span><br/>');
        html.push('<table border="0" cellpadding="1" cellspacing="1" >');
        html.push('  <tr>');
        html.push('      <td align="left">名 稱:</td>');
        html.push('      <td colspan="2"><input type="text" maxlength="50" size="18"  id="txtName"></td>');
        html.push('      <td valign="top"><span class="star">*</span></td>');
        html.push('  </tr>');
        html.push('  <tr>');
        html.push('      <td align="left">備 注:</td>');
        html.push('      <td colspan="2"><input type="text" maxlength="50" size="18"  id="areaDesc" style="width: 100%;height:50px;display: inline-block;"></td>');
        html.push('      <td valign="top"></td>');
        html.push('  </tr>');
        html.push('  <tr>');
        html.push('      <td  align="center" colspan="3">');
        html.push('          <input type="button" name="btnOK" id="OK" onclick="add()"  value="確定" />&nbsp;&nbsp;');
        html.push('          <input type="button" name="btnClear" ng-click="clear()" value="重填" />');
        html.push('      </td>');
        html.push('  </tr>');
        html.push('</table>');

        function add() {
            console.log("OKOKOKOK");
        }

        $scope.clear = function() {
            console.log("fnClearfnClearfnClearfnClear");
        }

定義了兩個方法,add()和clear(),但是兩個無論如何都不觸發(fā)什么情況??

回答
編輯回答
款爺
2018年9月8日 00:35
編輯回答
安淺陌
2017年2月11日 01:42