Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Ambita.

...

mFlex.init

This is used for configuration and injection of the components

...

Code Block
languagetypescript
Infoland.Mflex.init({
  element: '#infoland',
  environment: 'test',
  category: 'realtestate',
  token: tokenObject,
  reference: '123456789',
  technicalReference: '123456789',
 
priceSurcharge: 1.1,   externalDepartmentId: 1234,
  onOrderConfirmed: (orderId) => {
    console.log(orderId)
  }
});

Name

Required

Type

Options

Description

element

True

string

This property is used for setting the id of the html element you want the components to load.

environment

True

string

test & prod

The environment you want connect to

category

True

string

realtestate

Determine what type of products that will be available in the product list. If your application have different types of users, you might want to make this dynamic based on the logged in user (brokers and architects might want different products).

token

True

object / string

This is where you pass in the token object for the logged in user, returned from the authentication service, see Authentication for more information.

reference

True

string

The reference property is added to the order when placed. This must be something that connects the order to the entity in your application that the user can relate to and have an understanding of. Could be an ID or key unique to an assignment or a project. The reference will show up on the invoices from Ambita

technicalReference

False

string

The technical reference is added to the order and can be used by your application, in case you want to track the orders. We recommend using this when handling file deliveries, see File deliveries .

priceSurcharge

False

number

An extra surcharge in percentage that will be displayed only in the components, example: 1.1 = 10%

externalDepartmentId

False

number

Used in spesial cases only

onOrderConfirmed

False

function

This function must be used to save the order id in your application, you need this to handle file deliveries later, see File deliveries .

...

Ambita.mFlex.productList.load

This function will load product list and takes in a json object as a search query.You should try to fill out as much as possible of these fields, depending on what type of property you want to buy products on. You should always try to fill out as much as possible and the components will figure out what property you are looking for based on the query.

Example

Code Block
languagetypescript
InfolandAmbita.mFlex.MflexproductList.load('query-selector', {
  cadastre: {
    knr: '0301',
    gnr: '1',
    bnr: '1',
    fnr: '0',
    snr: '0'
  },
  share: {
    organizationNumber: '123456789',
    shareNumber: '123'
  },
  address: {
    street: 'Storgata',
    houseNumber: '1',
    houseLetter: 'A',
    postalPlace: '1234',
    postalCode: 'OSLO'
  },
  owner: {
    socialSecurityNumber: '12345678910',
    organizationNumber: '123456789',
    name: 'Ola Kari Nordmannkey: '1234567-123'
  }
});

Cadastre

Name

Description

knr

Municipality number (Kommunenummer)

gnr

Cadastre Unit number (Gårdsnummer)

bnr

Unit number (Bruksnummer)

fnr

Leasehold Unit number (Festenummer)

snr

Section number (Seksjonsnummer)

Share

Name

Description

organizationNumber

Organization number of the cooperative

shareNumber

The number of the “right of occupation” (andelsnummer)

...

Address

Name

Description

socialSecurityNumber

The official number of the person owning the property

organizationNumber

The organization number of the company owning the property

name

The name of the person owning the property

Address

Name

Description

street

The street name

houseNumber

The street number

houseLetter

The house letter

postalPlace

The postal place

postalCode

The postal code

key

If you have used the search to find the property, the object from the result will contain a address key, add it here, some properties has multiple addresses.

Ambita.mFlex.search.load

This function will load the search inside a element

Code Block
Ambita.mFlex.search.load('query-selector');