Getting started with cars widgets

Steps to embed widgets are -

  1. Import zone.js with version >= 0.9.0 from . You should not import zone.js if it is already being loaded.

  2. Import Marketcheck widgets js file from Marketcheck Widgets code section.

  3. Once you have filled in all required parameters, you will see code generated in the Embed section. You need to copy generated styles in your stylesheet and generated tag in your HTML.

In case, if zone.js is being loaded by any framework your are using (like Angular), to make sure it is loaded before your Marketcheck widgets javascript is loaded, you can add Marketcheck widgets javascript file dynamically like this -

document.addEventListener(‘DOMContentLoaded’, function() {
let node = document.createElement(“script”);
node.src = ‘url of mc-widgets.js’;
node.type = “text/javascript”;
}, false);

more detailed explanation is available here.