java如何调用新窗口,如何打开API服务调用新窗口?

我尝试打开API服务调用新窗口选项卡,但尝试使用 window.open() ,它不起作用 . 我也试着把 ng-href="URLwithParam" in the HTMLtemplate with target="_blank" . 我是角度和HTML的新手 . 请帮我

define(['directives/directives'],

function (directives) {

directives.directive('directiveFeeReport', ['reportServices', function (reportServices) {

var prmCompanyId;

var prmDateTranFrom;

var formattedPrmDateTranFrom;

var prmDateTranTo;

var formattedPrmDateTranTo;

var urlLink = "http://localhost:8080/sdimngapi/np_feereport/feeReportGenerate/";

var teststring;

function feeReportController( $stateParams, notification) {

this.roleId = $stateParams.id;

// notification is the service used to display notifications on the top of the screen

this.notification = notification;

};

feeReportController.$inject = ['$stateParams', 'notification'];

function init(scope, element, $stateParams, $window, $http) {

scope.generateFeeReport = function() {

prmCompanyId = scope.companyId;

prmDateTranFrom = new Date(scope.dateTranFrom);

formattedPrmDateTranFrom = prmDateTranFrom.getFullYear() + '-' + (prmDateTranFrom.getMonth() + 1 ) + '-' + prmDateTranFrom.getDate();

prmDateTranTo = scope.dateTranTo;

formattedPrmDateTranTo = prmDateTranTo.getFullYear() + '-' + (prmDateTranTo.getMonth() + 1 ) + '-' + prmDateTranTo.getDate();

// I TRY TO OPEN THE Service API calls to new window here.

//window.open('/theURL', '_blank');

// API Calls

reportServices.GetFeeReport(prmCompanyId, formattedPrmDateTranFrom, formattedPrmDateTranTo, function (res) {

//console.log(res);

})

});

};

//#region HTML Template

var feeReportTemplate = '

';

return {

restrict: 'E',

link: init,

controller: feeReportController,

controllerAs: 'controller',

template: feeReportTemplate

};

} ]);

});

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值