angular - Sending string one component to other component in angular2 -


i want send username login component home component ...how can please tell me simple example showing sending string 1 component use angular2 cli , vs code editor

use @input

import { component, input } '@angular/core';

@component({ selector:'counter', inputs: ['number'] }) export class countercomponent {

@input() count: number = 0; 

}

@component({ selector: 'counter-sibling', template: '' }) export class countersibling{

@output() count: number = 0; 

} usage in counter-sibling:


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -