案例:

在IONIC中使用百度地图的JS版SDK,在该JS相关界面中需要触发点击事件来实现在Ionic的JS中定义的函数,参考方法如下:

onclick="var $scope = angular.element(event.target).scope();$scope.hello()"

 

其中var $scope = angular.element(event.target).scope()代码就是当前js被触发时候的那个scope

相关文章:

  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2021-06-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-24
  • 2021-09-14
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案