Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

160
Vistas
How to use collections.js in typescript?

I want to use collections.js in my typescript Angular2 project. I want to start with multimap. There's no @types/collections package and there's no collections.js in typings.

When I write

const MultiMap = require('collections/multi-map')

I got "NoProviderError for PlatformRef" in Agnular2.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

An error NoProviderError is caused by the fact that collection.js library changes the way how built-in primitives work, particularly Array.

Internally, zone.js (which is a part of Angular) invokes Array.from with an instance of MapIterator as an argument. In collections/shim-array.js file, this library overrides Array.from with an implementation, that doesn't work with MapIterator. In screenshot you can see, that it returns an empty array, while native implementation returns an array of 13 elements.

enter image description here

A conclusion is, that sadly you can't use Collections.js library with Angular.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda