This library is intended for Angular version > 9.0.2.

Usage no npm install needed!

<script type="module">
  import advsolCore from 'https://cdn.skypack.dev/@advsol/core';



This library is intended for Angular version > 9.0.2.

It will handle authentication for all your HTTP requests to the iMIS API from Angular based iParts, automatically adding on the RequestVerificationToken, from the DOM and correctly setting the path for your HTTP requests.


npm install @advsol/core


Add AsiCoreModule to your imports. This will enable the interceptor, which will add the RequestVerificationToken header to all of your HttpClient requests.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { AsiCoreModule } from '@advsol/core';

  declarations: [
  imports: [
  providers: [],
  bootstrap: [AppComponent]
export class AppModule { }


import { Component } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';

  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
export class AppComponent {
  title = ' iMIS!';

  constructor(private http: HttpClient) {}

  // Get Settings for the current iPart
  example(): void{
    const ck = (document.querySelector("#x-contentKey") as HTMLInputElement).value;
    const cik = (document.querySelector("#x-contentItemKey") as HTMLInputElement).value;    
    const params = new HttpParams()
    .set('contentKey', ck)
    this.http.get("api/ContentItem",{params: params}).subscribe((data) => {

Helper Service

The CommonService class can simplify calling the iMIS API even further. It is able to determine the correct API resource from your data contract and also removes the paging JSON from the data.


Create your model

import {DataContract} from  '@advsol/core';

export class ContentItemData extends DataContract {
    $type = 'Asi.Soa.Core.DataContracts.ContentItemData, Asi.Contracts';
    Data: Data;

interface Data {
    ContentKey: string;
    ContentTypeKey: string;

Using your model in a service

When using the CommonService @advsol/core will automatically determine the correct API resource from your model.

  providedIn: 'root'
export class IpartSettingsService extends CommonService {

  constructor(private http: HttpClient, private contentKeys: ContentKeysService) {

  public GetSettings (): Observable<ContentItemData>
    const params = new HttpParams()
    .set('contentKey', this.contentKeys.contentKey)
    return this.single(ContentItemData,params);


  • single
  • find
  • add
  • update
  • execute
  • delete

The sample project here shows how to use this package.