0

I have to pass a map (not a primitive - that works fine) from angular 2 component into a custom directive, but just keep getting a string - "[object Map]"

TS:

differences : Map<string,ObjectDifference>

HTML:

<input  type='text' differences={{differences}}> // I feel that's where the problem is

Directive code:

@Input('differences') differences : Map<string,ObjectDifference> 

Value in directive at runtime:

differences: "[object Map]"
Yuri Gridin
  • 469
  • 5
  • 6

1 Answers1

0

And of course the right html is simply :

[differences]="differences"

Yuri Gridin
  • 469
  • 5
  • 6