The best answer I found is the ui.router extension, since the function does not exist. You can find the full information here:
Angular Extension 1.x ui-router $ state.go
However, here is my brief explanation of what needs to be done, add this to app.js or the file with the corner app app:
angular.module("AppName").config(['$provide', function ($provide) { $provide.decorator('$state', ['$delegate', '$window', function ($delegate, $window) { var extended = { goNewTab: function (stateName, params) { $window.open( $delegate.href(stateName, params, { absolute: true }), '_blank'); } }; angular.extend($delegate, extended); return $delegate; }]); }]);
In your code
You can:
$state.goNewTab('routeHere', { parameter1 : "parameter"});
Dalorzo Jul 27 '18 at 21:02 2018-07-27 21:02
source share