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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -