### File

`src/app/shared/services/text.service.ts`

### Index

###### Properties
Public resultText
###### Methods
Public enhancedDoc Public enhancedImage Public enhancedPDF enhancedText

### Constructor

`constructor(http: HttpClient)`
Defined in src/app/shared/services/text.service.ts:14
Parameters :
Name | Type | Optional | Description
http | `HttpClient` |  |

### Methods

Public enhancedDoc
`enhancedDoc(formdata: FormData)`
Defined in src/app/shared/services/text.service.ts:25
Parameters :
Name | Type | Optional | Description
formdata | `FormData` |  |
Returns : `Observable<>`

Public enhancedImage
`enhancedImage(formdata: FormData)`
Defined in src/app/shared/services/text.service.ts:35
Parameters :
Name | Type | Optional | Description
formdata | `FormData` |  |
Returns : `Observable<>`

Public enhancedPDF
`enhancedPDF(formdata: FormData)`
Defined in src/app/shared/services/text.service.ts:30
Parameters :
Name | Type | Optional | Description
formdata | `FormData` |  |
Returns : `Observable<>`

enhancedText
`enhancedText(textArea: string)`
Defined in src/app/shared/services/text.service.ts:19
Parameters :
Name | Type | Optional | Description
textArea | `string` |  |
Returns : `Observable<>`

### Properties

Public resultText
`resultText: `IText``
Type : `IText`
Defined in src/app/shared/services/text.service.ts:14

    import { Injectable, Inject } from '@angular/core';
    import { Http, Response, Headers } from '@angular/http';
    import { Observable } from 'rxjs/Observable';
    import { HttpClient, HttpErrorResponse } from '@angular/common/http';
    import { IText } from '../interface'

    import 'rxjs/add/operator/do';

    @Injectable()
    export class TextService {

      // TextService store the result from text component into resultText so later on can be passed to enhancedTextResultPage
      public resultText: IText;

      constructor(private http: HttpClient) {
      }

      enhancedText(textArea: string): Observable<IText> {
        return this.http.post<IText>('/api/analyzeText', textArea)
          .do((res => console.log(res)));
      }

      public enhancedDoc(formdata: FormData): Observable<IText> {
        return this.http.post<IText>('/api/analyzeFile?type=DOC', formdata)
          .do((res => console.log(res)));
      }

      public enhancedPDF(formdata: FormData): Observable<IText> {
        return this.http.post<IText>('/api/analyzeFile?type=PDF', formdata)
          .do((res => console.log(res)));
      }

      public enhancedImage(formdata: FormData): Observable<IText> {
        return this.http.post<IText>('/api/analyzeFile?type=IMG', formdata)
          .do((res => console.log(res)));
      }

    }

# results matching ""

# No results matching ""