编译角度代码以便能够执行内部html操作

Compile angular code to be able to do innerhtml action

本文关键字:执行 内部 html 操作 代码 编译      更新时间:2024-02-24
function campform() {
    $.ajax({url: "{{ path('campform') }}", success: function(result){
        $("#respuesta").html(result);
    }});
}
结果

有角度代码,它不起作用,我不知道我必须如何编译结果。

嘿,这不是角度的方式:-(

您应该使用$http服务进行此类调用

$http.get('/someUrl').
  success(function(data, status, headers, config) {
     $("#respuesta").html(result);
  }).
  error(function(data, status, headers, config) {
    // called asynchronously if an error occurs
    // or server returns response with an error status.
  });