Ash
Ash

Reputation: 896

How to pass instance variables via attributes in AngularDart?

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

Answers (1)

G&#252;nter Z&#246;chbauer
G&#252;nter Z&#246;chbauer

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

Related Questions