Angular 2 - What is equivalent to Root Scope?

Viewed 50392

All! I've this component where when I click on the href it is supposed to set a variable as Root Scope if it was Angular 1 like this:

selector: 'my-component'
template : `
            <div (click)="addTag(1, 'abc')">`

constructor() {
    this.addTag = function(id, desc){
        myGlobalVar = { a: id, b: desc};
    };

Then in my parent component, the page itself (in fact) I should be doing something like:

<my-component></my-component>
<p>My Component is returning me {{ ?????? }}

What is the best approach to do such a thing?

3 Answers
Related