0
你能幫我把它轉換成正確的打字稿(angular2)嗎?typescript範圍錯誤與.indexOf
import { UtilsService } from '../providers/utils-service';
@Injectable()
export class ImagesService {
constructor(
private connectionStatus: ConnectionStatus
, private UrlExists: UrlExists
, private storageService: LocalStorageService
, private UtilsService: UtilsService
) {
}
usualTreatment(prodata, gotANewDB) {
if (str.indexOf(suffix, this.length - suffix.length) === -1) {
...
,因爲我得到一個範圍錯誤:
Typescript Error
Property 'length' does not exist on type 'ImagesService'.
src/providers/images-service.ts
for (var str in imagesUrls) {
if (str.indexOf(suffix, this.length
你有ImagesService類 –
this.length屬性,我們需要更多的背景下,什麼是包裝if語句,方法,函數,箭頭函數?請提供更多的代碼,如果需要的話,你的整個班級。 – n00dl3
請發送'images-service.ts'代碼 –