1 bodyApp.controller('customersCtrl', function ($scope, $http, cfpLoadingBar,$compile) {
2 $scope.test = function(){
3     alert('test');
4 }
5 
6 // TODO 动态生成html中 ng-click无效 解决方法 $compile 是传进来的
7 var html = '<a href="javascript:void(0);" ng-click="$scope.test();"></a>'
8 $("body").append($compile(html)($scope));
9 });

 

相关文章:

  • 2022-12-23
  • 2021-12-24
  • 2021-05-25
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-24
相关资源
相似解决方案