Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 2 Map<String, List<String>> is possible to create? [closed]

is possible to create in angular 2 Map< String, List< String >>?

like image 715
Mateusz Sobczak Avatar asked Jun 08 '26 05:06

Mateusz Sobczak


1 Answers

Map is ES6 feature and have nothing to do with Angular 2. You can create it using

var map = new Map<string, string[]>();
map.set('key', ['a', 'b', 'c']);
map.get('key');

You also need to set "module": "es6" in your tsconfig.json or use es6-shims definitions.

like image 198
Andzej Maciusovic Avatar answered Jun 10 '26 18:06

Andzej Maciusovic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!