public function handle($request, Closure $next)
{
$response = $next($request);
if ($response instanceof Response) {
$response->headers->add([
'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Headers' => 'authorization, allow',
'Access-Control-Allow-Methods' => 'GET, POST, PUT, DELETE, OPTIONS'
]);
}
return $response;
}
.state("userState", {
parent: "app.new",
params: {
userId: 0
},
onEnter: [
"$modal", "$state"
function($modal,$state) {
$modal.open({
controller: "UserModalController",
templateUrl: 'users/modals/user-modal.html',
}).result.finally(function() {
$state.go('^');
});
}
]
});