2017-07-19 38 views
0

我使用庫。 「Angular 4.x,DataTable,Typescript」打字稿,部件之間的通信

從其他組件調用函數時不能使用http?

我必須使用。有沒有辦法? 請幫我...

enter image description here


enter image description here


enter image description here


enter image description here

+3

您可能只需要注入'http'服務。但是,請將代碼作爲文本發佈,如果可能的話,製作一個plnkr示例,以便可以重新生成問題。 – nipuna777

+1

你可以簡單地添加代碼而不是圖片。我無法清楚地看到照片。 – CharanRoot

+0

我添加圖片..請再看一遍 –

回答

0

請在app.module.ts中輸入HttpModule

+0

我添加圖片.. 請再看一遍 –

+0

這裏其實問題是無法確定'this'關鍵字。 你可以嘗試的一件事,而不是通過下載到您的jQuery回調分配這一些變量像 調用之前'令x =這一點;' 再嘗試這樣的事情在你的回調 'x.appDownload(。 ...);' –