title: Merge Map operator in Angular usage
body: <p>I'm not able to return the inner observable </p>
  
  <p>createItem -> Will create the item  (POST request)
  The resposne form that item contains ID , by using that ID I'm adding attachemnts to the Item.</p>
  
  <p>addAttachmentstoItem -> POST request</p>
  
  <p>selected file -> contains attached files in the form , we are looping through each file &amp; calling the addAttachmentstoItem post request.</p>
  
  <p>Merge Map operator for inner observable isn't able to return the observable</p>
  
  <pre><code>this.sharepointService.createItem(this.itemData)
    .pipe(
      mergeMap  (( response : Response) =&gt; {
        this.lastItemCreatedId = response['d'].ID
        this.selectedfile.forEach( (file) =&gt; {
          let filename = file.name
          let url = "_spPageContextInfo.webAbsoluteUrl"+"_api/web/lists/getByTitle('"+ libraryName +"')/items("+this.lastItemCreatedId+")/AttachmentFiles/add(FileName = '"+filename+"')"
        return this.sharepointService.addAttachementstoItem(url,filename).subscribe( response =&gt; console.log("File Uploaded"))
   })
      }),
    ).subscribe()
  </code></pre>
  
  <p>code in the sharepointService :</p>
  
  <pre><code> createItem(itemData): Observable&lt;Object&gt; {
   console.log("Inside postItem")
   console.log(itemData.reqno)
    var body = {
      "__metadata" : {'type' : 'SP.Data.CustomListListItem'},
      'Title' : 'first',
      'Requisition_x0020_Number' : itemData.reqno,
      'Site_x0020_Security_x0020_Groups' : itemData.sitesecuritygroups,
      'User_x0020_Security_x0020_Groups' :itemData.usersecuritygroups,
      'Attachments' : itemData.selectedfile
    }
    return this.http.post(this.baseUrl+"_api/web/lists/getbytitle('CustomList')/items",body)
   }
  
   addAttachementstoItem(url,selectedfile): Observable&lt;Object&gt; {
     console.log(url)
     return this.http.post(url,selectedfile)
   }
  
  </code></pre>
  
  <p>I'm getting the error : Argument of type '(response: Response) => void' is not assignable to parameter of type '(value: Response, index: number) => ObservableInput'.
    Type 'void' is not assignable to type 'ObservableInput'.</p>