You can't use `this` in binding expressions but you can create a getter or 
function in your component that returns `this`. You can then use this 
getter or function in your binding expression.



On Tuesday, March 1, 2016 at 5:36:55 AM UTC+1, Jason Connell wrote:
>
> Good evening,
>
> Is there a way to send the current component as a parameter to the child 
> component?
>
> I think this plunker will explain pretty accurately what I'm trying to do: 
>  http://plnkr.co/edit/5xToh9aIQFtHwh1P2BRn?p=preview
>
> <edit-toggle [editable]="this" ... ></edit-toggle>
>
> I've worked around it by having a .asEditable() method on the abstract 
> Editable class, which just returns this.  I'm fine with this approach 
> unless there's a way to more directly pass "this". It will help with some 
> code reuse, but I'm also not in love with this approach, so if there's a 
> better way (maybe construct a new, concrete Editable object in my 
> component. But really what I'm signifying is that the component itself is 
> editable). More discussion around this and the ideas behind it is also 
> welcome, the app is young, paths can be nudged :)
>
> Thanks for your help!
>
> Jason
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to