BackendConnectorExpander

Expands:

$applicationRoot.directory$/native/ionic/src/app/services/backend-connector.service.ts

if:

true
property value
element type ApplicationInstance
qualified name net.democritus.expander.ionic.applicationinstance.service.BackendConnectorExpander
layer ROOT
technology COMMON
sourceType JS
phase expansion
features  

Example

Some example of the content generated by the expander:

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class BackendConnectorService {

  baseUrl = '';

  constructor(
    private http: HttpClient,
  ) { }

  login(user): Observable<any> {
    const url = `${this.baseUrl}/account/user-search-json`;
    const userToken = 'Basic ' + btoa(user.name + ':' + user.pass);

    const options = {
      params: {
        searchMethod: 'findByNameEq',
        projection: 'details',
        'details.name': user.name
      },
      headers: {
        Authorization: userToken
      }
    };
    return this.http.get(url, options);
  }

  getBaseUrl(): string {
    return this.baseUrl;
  }

  get(url: string, options: any): Observable<any> {
    return this.http.get(url, options);
  }

  post(url: string, body: any, options: any): Observable<any> {
    return this.http.post(url, body, options);
  }

}