How to refresh the contents without reloading page?

I have to refresh the contents of page without reloading the page in javascript. This is not working.

window.location.assign("#/invoice/" + $scope.invoiceId);

Use AJAX. jQuery provides a nice wrapper for that.

http://jQuery.com/

This example loads ajax/test.html into you #content div:

$.get('ajax/test.html', function(data) {
     $("#content").html(data);
});