javascript - AngularJS Ajaxify entire website -


i' working history api , jquery in order ajaxify website.

all links fires ajax calls retrieve page , replace actual content fetched content, user can navigate without page reload. how can achieve using angularjs ?

i took @ $location doc, , created directive on links. directive stop default event , use $location.path() set new url.

angular.module('directives.ajaxnavigation', [])  .directive('a', ['$location', function($location) {     return {         link: function(scope, ielement, iattrs) {             ielement.bind('click', function(e) {                 console.log(ielement.attr('href'));                 scope.$apply($location.path(ielement.attr('href')));                 e.preventdefault();             });          }     } }]); 

how can capture "urlchange" event in order make ajax call each time fired ?


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -