I am trying to import this JS library into my Ionic 4 project: 'https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js' to use it in my angular componets. I've been looking all over the web without solution.

I tried to import into my angular.json file but is not working.

"scripts": ["https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js"]

Also I tried to import directly from my index.html but it seems is not able to read it.

Docs link

1 Answers

Paresh Gami On Best Solutions

You can try like this


import { Component } from '@angular/core';
declare var Mercadopago: any;

  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
export class HomePage {
  constructor() {


<script src="https://secure.mlstatic.com/sdk/javascript/v1/mercadopago.js"></script>