Reputation: 2608
How can I convert this to proper TypeScript (Angular2) ?
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) {
...
because I get a scope error :
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
Upvotes: 0
Views: 108
Reputation: 657376
I assume you mean
if (str.indexOf(suffix, str.length - suffix.length) === -1) {
^^^
Upvotes: 1