Databinding from within a template in angular


In a component how to databind(two-way) for the following example. (@jen.looper)

Here is the template

<ListView [items]="channels$ | async" class="list-group">
    <ng-template let-dataitem="item">
       <Button [text]="dataitem.isSelected?'UnFollow':'follow'" (tap)="dataitem.isSelected?unfollow(dataitem):follow(dataitem)"></Button>

Here are the functions

 unfollow(dataitem) {
    dataitem.isSelected = true;//not working
 follow(dataitem) {
    dataitem.isSelected = true;//not working


when you tap, is the dataitem.isSelected boolean toggling? There’s an example of this kind of toggling here:


A proper answer? She just gave you a hint on where to search for information regarding your problem.
You need to overcome the problems yourself.
If everytime you have a problem you ask for the solution you will never evolve and progress.

You should always look for suggestions or hints on how to do something and then do it yourself, this way you improve and become better at it.

And regarding the two-way data binding it is pretty well explained on the Groceries tutorial.


Such answers on stackoverflow generally get downvoted and deleted.
I can provide you hundreds of such links of sample codes but those links are not my problems. My problem is with understanding the flow of the above code.
If my intention was to seek advice on how to search why would I paste the code in the first place?


We are trying to help here. I gave you some pointers. Answering back this way doesn’t make me particularly eager to continue to help.


@ishandutta2007 with a tutorial on how to make friends and influence people…


No issues I may have over reacted, I realised telerik support team might be confined to support related to nativescript documentations which makes sense also.
For code debuging and code analysis questions I will continue on stackoverflow which I am more used to.