Reputation: 896
I am trying to pass the instance variable, jsonString, of ComponentA to CustomElement:
<CustomElement jsonFilters="{{jsonString}}"></CustomElement>
Currently, the value mapped from jsonFilters is empty/null. What is the correct way to pass a string to a custom element? Any help much appreciated
Upvotes: 0
Views: 176
Reputation: 657028
In Angular 2 this should be
<CustomElement [jsonFilters]="jsonString"></CustomElement>
and this is property binding not attribute binding. Attributes only support strings not objects.
Upvotes: 1