mathiasbynens / Array.from

A robust & optimized ES3-compatible polyfill for the `Array.from` method in ECMAScript 6.

Home Page:https://mths.be/array-from

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I use this in my Angular2 project

rickysullivan opened this issue · comments

Using systemjs:

'array.from': 'node_modules/array.from'

In my .ts file:

import 'array.from';

Array.from({...})

Returns this error...

Property 'from' does not exist on type 'ArrayConstructor'.

Per the documentation, you need to import ArrayFrom from 'array.from' and then ArrayFrom.shim() if you want it installed on the global Array method.