Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. app.factory('scope', function($location, $http) {
  2.     var param = $location.$$path;
  3.     param = param.replace('/','');
  4.     if (param == '') {
  5.         param = 'front-page';
  6.     }
  7.     param = param.replace(/\/(?=\w+)/, '--');
  8.     return $http.get('/drupal/pages/' + param);
  9. }).
  10. //////////
  11.  
  12. .controller('pageController', function(scope) {
  13.     scope.success(function(data){
  14.         $scope.page = data;
  15.     }
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement