Skip to content

Instantly share code, notes, and snippets.

@iagosousadev
Created October 6, 2021 15:31
Show Gist options
  • Save iagosousadev/8cb95a2134ae2cc4426d51cd06fc5d2d to your computer and use it in GitHub Desktop.
Save iagosousadev/8cb95a2134ae2cc4426d51cd06fc5d2d to your computer and use it in GitHub Desktop.
.state('redirectArquivo', {
url: "/download/:codigo",
resolve : {
async function($stateParams, $state, $http, $timeout) {
if ($stateParams.codigo == undefined || $stateParams.codigo == "") {
$state.go('404');
} else {
sessionStorage.setItem('codigo', $stateParams.codigo);
$timeout(function() {
$state.go('downloadArquivo');
},0);
}
}
}
})
.state('downloadArquivo', {
url: "/download",
controller: 'PublicController',
templateUrl: 'views/public/arquivo.view.html'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment