使用Aangular JS和Google Maps JS API显示按钮点击方向的问题

时间:2016-04-12 03:39:42

标签: angularjs google-maps ionic-framework

我一直试图在我使用Ionic Framework构建的小应用程序中获得一个按钮。

现在,按钮的工作非常简单,点击地图上的显示方向。当在控制器中调用该函数时,它会在地图上显示,但当我尝试通过点击调用它时,我无法显示指示。

想知道问题可能在这里。

    <div style= "position: absolute; bottom: -10px; width: 100%" ng-controller="MapCtrl">
      <button class="button button-block button-balanced" ng-click = "show_dirs">Find Parking Near Me</button>
    </div>

HTML按钮:

Page.getBrowserWindowHeight();
Page.getBrowserWindowWidth();

1 个答案:

答案 0 :(得分:1)

您的ng-click属性不正确。单击按钮时,应该使用Angular 表达式进行评估和执行。

您拥有的内容show_dirs将评估函数本身。你想要的是实际上调用那个功能。

所以它应该是ng-click="show_dirs()"