我有一个angular2应用程序,我想连接到一个本地rest服务,它是用spring引导构建的。我希望能够在自己的端口上运行rest服务,然后在不同的端口上运行angular2应用程序,但能够对rest服务进行http调用。我使用postman来测试rest服务,而rest服务似乎正在按预期运行。
如何设置angular2应用程序,使其能够对本地rest服务进行http调用?
当我在我的angular2应用程序中使用这段代码时,我会得到一个对我来说毫无意义的错误。这是密码。
在app.component中
var data={data:"hi from angular2"};
我有一个用AngularJS编写的JavaScript服务,我想把它转换成TypeScript。Javascript版本立即返回一个函数。它为什么要这样做,我将如何在TypeScript中实现这一点?
JavaScript
Geisha.service("loginModal", ["$uibModal", "$rootScope", function ($uibModal: angular.ui.bootstrap.IModalService, $rootScope: ICustomRootScopeService) {
function as