Angularjs: how to revert back to the runtime loaded DOM elements in the previous view on going back (preserve state)
I have an angular application which has two views: 1) List view 2) Detail View when you click on the thumbnail from list view you go to detail view, here is the route: app.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/list', { templateUrl: 'partials/list.html', controller: 'ListCtrl', }). when('/list/:id', { templateUrl: 'partials/detail.html', controller: 'DetailCtrl', }). otherwise({ redirectTo: '/list' }); }]); Now there is a function loadmore in 'listCtrl' controller which is used to load myControllers.controller('ListCtrl', ['$scope', '$location', 'Troll', '