Created
October 6, 2021 15:31
-
-
Save iagosousadev/8cb95a2134ae2cc4426d51cd06fc5d2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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