Вопрос по AngularJS
Есть скрипт, перехода между страницами, путём подгрузки:
var main = {
loading: function() {
var app = angular.module('mainJContent', []);
app.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider.
when('/', {
templateUrl:'/lib/php/index',
title: 'Hello World'
}).
when('/profile/', {
templateUrl:'/lib/php/profile',
title: 'Profile'
}).
when('/action/', {
templateUrl:'/lib/php/action?_='+Math.random(),
title: 'Action'
}).
otherwise({
redirectTo:'/'
});
});
app.run(['$location', '$rootScope', function($location, $rootScope) {
$rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
if (current.$route) {
$rootScope.title = current.$route.title;
}
});
}]);
}
};
Так вот, как сделать к примеру, чтобы был запрос к примеру Profile, GET запросом:
when('/profile/123 (Типо id)', {
templateUrl:'/lib/php/profile?i=123',
title: 'Profile'
}).
Источник: Stack Overflow на русском