What I want to do is following in but in a new Tab or new Window:
$state.go('studentsReport', {
type: $scope.report.type, // string
selectedStudents: $scope.selectedStudents // array of strings
});
If I did:
var link = $state.href('studentsReport', {
type: $scope.report.type,
selectedStudents: $scope.selectedStudents
});
window.open(link, '_blank');`
I would lose the parameters.
Best regards, Marcel
You should trying to use this:
/* @ngInject */
function SomeCtrl ($state, $window) {
$window.open($state.href('stateName', {}, {absolute: true}), '_blank');
}
Note: the /* ngInject */
facilitates automatic dependency injection annotation if using ng-annotate (available in cli, gulp, and grunt flavours)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With