Click Me it works fine and the parameter passed if I remove the target att" /> Click Me it works fine and the parameter passed if I remove the target att" /> Click Me it works fine and the parameter passed if I remove the target att"/>
<a ui-sref="app.reports.equipmentarg({factoryId: fid})" target="_blank">Click Me</a>

it works fine and the parameter passed if I remove the target attribute but then it opens in the current tab which is not required. I want to open my page in a new tab with parameters successfully passing using the same approach

state('app.reports.shiftarg', {url: '/shift',
templateUrl: 'assets/app/modules/report/views/view/app.shift.report.html',
controller: 'ShiftReportCtrl',
params: { factoryId: null}
1

There are 1 best solutions below

1
Mohammed Yousry On

As long as you used the url property, so you don't need the params property

so you have to add all the needed params to the url

state('app.reports.shiftarg', {
    url: '/shift/:factoryId',
    templateUrl: 'assets/app/modules/report/views/view/app.shift.report.html',
    controller: 'ShiftReportCtrl'
})

then in the html, you can use ui-sref

<a ui-sref="app.reports.equipmentarg({factoryId: fid})" target="_blank">Click Me</a> 

note that you missed the closing double quotation " before the target attribute