Q: Angular2 share data I have a component called UserListComponent, which own User array. I want this array to be accessible from another component.
UserListComponent :
import { Component, OnInit } from '@angular/core';

import { User } from './user';
import { UserService } from './user.service';

@Component({
    selector: 'user-list',
    templateUrl: './app/user-list.component.html',
    styleUrls: ['./app/user-list.component.css']
})

export class UserListComponent implements OnInit {
    users: User[];
    followedUsers: User[] = new Array();

    constructor(
        private userService: UserService
    ) { }

    ngOnInit(): void {
    }
}

My second component :
import { Component, OnInit, Input }    from '@angular/core';
import { HttpModule }   from '@angular/http';
import { User } from './user';
import { UserService } from './user.service';

@Component({
    selector: 'carto',
    templateUrl: './app/carto.component.html'
})
export class CartoComponent {

    title: string;

    constructor(
        private userService: UserService
    ) { }

    ngOnInit(): void {


    }
}

I would like the "followedUsers" property to be accessible in "CartoComponent"
Those both components are instaciated in a parent one : "ExploitationComponent".
In the HTML file "exploitation.component.html" I instanciate my 2 components like this :
        <div class="col-md-12">
            <user-list></user-list>
        </div>

        <div class="tab-pane fade active in" id="map-suivi">
            <carto></carto>
        </div>

How can I do this ?
