1. 程式人生 > >Angular 4 報錯Property 'subscribe' does not exist on type 'void'.

Angular 4 報錯Property 'subscribe' does not exist on type 'void'.

get() {
// return this.mediaItems;
return this.http.get(“/api/MediaItem”).map(response => response.json());
}

-少了return
-少引用了import ‘rxjs/Rx’;

相關推薦

Angular 4 Property 'subscribe' does not exist on type 'void'.

get() { // return this.mediaItems; return this.http.get(“/api/MediaItem”).map(response =>

Angular響應式開發中報Property 'map' does not exist on type 'Observable'.引用rxjs也沒用。

之前在做一個angular的專案使用到響應式開發,在呼叫.map屬性時出現了問題。 系統一直報錯Property 'map' does not exist on type 'Observable<Response>'.於是上網尋找答案。發現又說通過

TS2339:;某個物件上不存在某個方法【例】:Property 'context' does not exist on type 'NodeRequire'.

簡單直接的說報錯說某個物件上 不存在某個屬性   開始以為寫錯了  然後翻看之前的js版本  發現 引用的模組都已同樣的模組用ts的角度說  引用的都已一個型別介面的物件  可為什麼js好使   ts就報錯呢因為 ts的語法有些變化  這裡筆者只說一點  用我們常見的   r

Typescript error :Property 'xxx' does not exist on type 'yyy'.

問題: Typescript error :Property mozRequestFullScreen' does not exist on type 'HTMLElement'. 其他類似問題:property  'xxx' does not exist on  typ

Angular5到Angular6:Property 'map' does not exist on type 'Observable'.

錯誤原因:angular6不再支援原來的Http,用HttpClient代替了原來的Http 解決方案: 1. import import {Http, Headers, Response} from '@angular/http';  改為=> impor

Angular使用ng build打包 Property 'setControl' does not exist on type 'AbstractControl'.解決方法

在專案打包出現setControl報錯解決方法: 對於用setControl設定多層級表單的值的用法,會出現這個報錯: 以下是正確的寫法: get services(): FormArray { return this.sltForm.get("Service") as Form

Property 'filter' does not exist on type 'Observable' 解決方法

  我想做的是監聽地址引數變化: import 'rxjs/operator/filter'; //... this.router.events .filter((event:Event) => event instanceof NavigationEnd) .s

解決TSProperty 'style' does not exist on type 'Element'

在使用queryselector獲取一個dom元素,編譯時卻報錯說property 'style' does not exist on type 'element'。 原因:這是typescript的型別檢查導致的,需要在querySelector方法前面加個型別斷言。 let frameConta

TS2339:;某個物件上不存在某個方法【例】:Property 'context' does not exist on type 'NodeRequire'.

簡單直接的說 報錯說某個物件上 不存在某個屬性   開始以為寫錯了  然後翻看之前的js版本  發現 引用的模組都已同樣的模組 用ts的角度說  引用的都已一個型別介面的物件  可為什麼js好使   ts就報錯呢

Android 7.0以上系統獲取以content開頭的檔案拿不到正確路徑,column-data-does-not-exist

我們專案的使用場景,手機qq開啟檔案,選擇其他開啟方式,選擇我們自己的應用開啟,通過intent.getData()獲取檔案地址,後來發現在Android7.0之後的版本,獲取到的地址不正確,說檔案不存在。日誌報錯column-data-does-not-exist, 經過一天的折騰,終於在網上

android studio run 的時候,the apk file does not exist on disk,

bsp mage gpo 重啟 build log nbsp oid alt 1.首先 clean rebuild,重啟,不能解決的話,再找到這個 然後是這裏: 不用填,點ok,ok即可,他喵的,卡我倆小時 android studio run 的時候,報the a

[ts] Property 'aaa' does not exist on type 'Window' 解決辦法

declare col true pre code 三種 style ext spa  第一種: (window as any).aaa 第二種: declare global { interface Window { aaa: any; } }

pb:Datawindow does not have UPDATE capability.

之一 介紹 因此 處理 span power 是否 ica ber 解決方向:可能是dw下,rows------>Update properties---------->有設置(此設置具體介紹如下) PowerBuilder中可以通過數據窗口的更新屬性(Upda

MYSQL 8.0+ :Client does not support authentication protocol requested by server 解決方案

前言 之前一直用mac的mysql都沒這個問題,在win上配環境就出了這個問題,網上查出的那個OLD_PASSWORD('新密碼')的方法是根本不行的,原因是根本就沒有這個欄位,大家可以執行下以下命令就清楚了。 mysql> show variable

MySQL 8.0.12 The table does not comply with the requirements by an external plugin. (errno 3098)

報錯資訊: panic: The table does not comply with the requirements by an external plugin. (errno 3098) (sql

mac Root chmod operation not permitted on file

系統:mac os 10.14.1 重啟電腦 mac使用者在升級系統之後,電腦啟用了SIP(System Integrity Protection),增加了rootless機制,導致即使在root許可權下依然無法修改檔案,在必要時候為了能夠修改下面的檔案,我們只能關閉該保護機制 1)重啟,過程中按住 comm

javaJunit單元測試:Test is not an annotation type

今天寫一個小demo是用到單元測試,但是當我在方法上加上@Test的時候報錯:Test is not an annotation type 最後發現是因為我的同一個包裡面有一個叫做Test的類,衝突了。把Test類改個名字或者刪掉,問題解決。

TypeScript 錯誤“property does not exist on value of type

在用TypeScript寫angular2或者ionic2專案時,匯入原來JavaScript程式碼,有時出現“property does not exist on value of type”問題 即該物件找不到此屬性,原因是ts是靜態語言,型別是需要定義的,未定義就有可

maven :pom.xml does not exist

[ERROR] The build could not read 1 project -> [Help 1] [ERROR]    [ERROR]   The project cn.e3mall