Quello che voglio fare è seguito in, ma in una nuova scheda o la finestra nuova:angolare uiRouter stato aperto in una nuova finestra o scheda con stateParams
$state.go('studentsReport', {
type: $scope.report.type, // string
selectedStudents: $scope.selectedStudents // array of strings
});
Se l'ho fatto:
var link = $state.href('studentsReport', {
type: $scope.report.type,
selectedStudents: $scope.selectedStudents
});
window.open(link, '_blank');`
I perderebbe i parametri.
Con i migliori saluti, Marcel
Grazie per voi risposta, ma questo non funziona. Ma devo dire che non ho usato il commento/* @ngInject * /, assumendo che sia solo un commento – molerat
@molerat Devo dire che non ho impostato i parametri nel secondo argomento di [$ state.href] (http: //angular-ui.github.io/ui-router/site/#/api/ui.router.state.$state) funzione. Dovresti provare a impostare il loro. –
Lo so, li ho impostati loro e non ha funzionato. Quale URL dovrebbe '$ stato.href ('stateName', {test: 'bla'}, {absolute: true})' return se diciamo che l'url normale sarebbe http: // localhost/stateName? – molerat