Like
// My First Component
@Component({
selector: 'app-component1',
templateUrl: './component1.html'
})
export class Component1 {
books: any[] = ['Java'];
}
// My Second Component
@Component({
selector: 'app-component2',
templateUrl: './component2.html'
})
export class Component2 {
// Now I want to push 'Angular2' in books array from here. So, How can i do this and remember there is no any relationship of parent child component.
}
I want to push object from Component2 to Component1.
I have already try with Observable.
Can you please help me in above scenario?