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 is no @ types / collections package, and there are no .js collections in typifications.

When I write

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

I got "NoProviderError for PlatformRef" in Agnular2.

+4
source share
1 answer

The error is NoProviderErrorcaused by the fact that the collection.js library changes the way primitive primitives work, especially Array.

zone.js ( Angular) Array.from MapIterator . collections/shim-array.js Array.from , MapIterator. , , 13 .

enter image description here

, , , Collections.js Angular.

+5

Source: https://habr.com/ru/post/1672990/


All Articles