finally i found an answer for this, and here it is
$routeProvider
.when('/claim/:code', {
templateUrl: 'views/RewardClaim.html',
controller: 'RewardClaimCtrl',
resolve: {
DataCode: ['Api', '$route', function (Api, $route) {
var code = $route.current.params.code,
DataCode = Api.code({code: code});
return DataCode.$promise;
}]
}
})
.when('/:slug', {
templateUrl: 'views/Page.html',
controller: 'PageCtrl',
resolve: {
DataPage: ['Api', '$route', function (Api, $route) {
var slug = $route.current.params.slug,
DataPage = Api.page({slug: slug});
return DataPage.$promise;
}]
}
})
.otherwise({
redirectTo: '/home'
});
this is where i found the solution: phillippuleo.com