We created a directive in Angular2 and have an input
property that should receive a string
. The problem is that, we are not able to pass a string.
If we try to do this:
<learning-requirements [title]="You should be able to!" [content]="requirements"></learning-requirements>
It does not work, so we have to do this, and then it works:
<learning-requirements [title]="'You should be able to!'" [content]="requirements"></learning-requirements>
That is our directive:
@Component({
selector: "learning-requirements",
directives: [IONIC_DIRECTIVES],
templateUrl: "build/pages/learning/components/requirements/requirements.html"
})
export class RequirementsComponent {
@Input() public title: string;
@Input("content") public items: Array<Requirement>;
}
Any idea how to handle string whithout explicitly using single quotation?