0
function campform() {
    $.ajax({url: "{{ path('campform') }}", success: function(result){
        $("#respuesta").html(result);
    }});
}

Result has angular code, and it doesn't work, I don't know how do I have to compile result.

isherwood
  • 58,414
  • 16
  • 114
  • 157
  • 3
    Please see http://stackoverflow.com/questions/14994391/thinking-in-angularjs-if-i-have-a-jquery-background as soon as possible. Manipulating the DOM like that defeats much of the purpose of using AngularJS. – isherwood Feb 20 '15 at 18:55
  • Many thanks I'm going to check it out !! – Ismael Chuliá Feb 23 '15 at 08:46

1 Answers1

0

Hey this is not angular way :-)

You should use $http service for such calls

$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.
  });
squiroid
  • 13,809
  • 6
  • 47
  • 67
  • I know it, this kind of code is inside of result. the angular tags don't work if they are printed by inner html. I think result has to be compiled to work. but I don't know how I can do it. – Ismael Chuliá Feb 23 '15 at 08:15
  • Sorry, I said wrong things, you mean If I print result (it has angular code inside) by this way, the result's angular code is going to work? – Ismael Chuliá Feb 23 '15 at 08:45