0

I am trying to clone html using AngularJS, I did it by using jQuery but it conflicts with angular so I want make with AngularJS. My code is given below:

function printContent(el){
    var restorepage = $('body').html();
    var printcontent = $('#' + el).clone();
    $('body').empty().html(printcontent);
    window.print(); 
    $('body').html(restorepage);
}

2 Answers 2

1

You can simply use JQlite for this

var myEl = angular.element( document.querySelector( '#divID' ) );
myEl.clone();

Remember to put the jquery file before the angular.js file in the HTML to make use of JQlite.

Sign up to request clarification or add additional context in comments.

Comments

0

document.querySelector('div[ng-app]').innerHTML

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.