Data transmission in a component of Angular 2?

In Angular 2 to transfer to a component variable with two way communication, such as the fact that in the first angular was made via
scope:{ 
data: '=',
callback:'&'
}

I tried like this
<my-component [(test)]="test" [(callback)]="callback"></my-component>

callback(){
console.log(this)
}

When you start kaveka in my-this component displays the parent component, not a my-component.
July 2nd 19 at 17:46
1 answer
July 2nd 19 at 17:48
banana in a box:

[(name)]='variable'
I tried, but I failed. The values are passed but bilateral ligament is not present. The function and passing it ispanets in the context of the component in which I give her - Cynthia.Donnelly commented on July 2nd 19 at 17:51
: How have you tried it? example on plunker please - brooks.Greenfelder commented on July 2nd 19 at 17:54
: https://plnkr.co/edit/0Y1VtQ9CPoBB9kfsE8XG?p=preview not for the first time to call the help answer, thanks in advance) - Cynthia.Donnelly commented on July 2nd 19 at 17:57
: https://plnkr.co/edit/RDBc4F9wwKuSV41tRhST?p=preview Looking for review magic - brooks.Greenfelder commented on July 2nd 19 at 18:00
: A huge thank you, kalbekov understood, and two-way communication variables? obj in the example - Cynthia.Donnelly commented on July 2nd 19 at 18:03
: found another option, the idea more proper to convey the kalbekov as iotov (callback)="callback($event)" - Cynthia.Donnelly commented on July 2nd 19 at 18:06

Find more questions by tags Angular