I have main app.component.ts,from here i am passing the currentstatus variable to the chid component(Navbar Component) which is navbar.component.ts and i have passed the value to the Navbar component using @input() decorator but I am getting problem how to pass this value of input decorator to navbar.component.html?
My main app.component.ts is
export class AppComponent {
public currentstatus: any;
constructor(private authService:LoginAuthService,private router:Router){
this.currentstatus=this.authService.getStatus().
subscribe(currentstatus => {
this.currentstatus=currentstatus;
})
}
logout(){
localStorage.removeItem('currentUser');
this.router.navigate(['login']);
}
From here i am passing this currentstatus
My app.component.html is
<div id = "wrapper">
<div class="main-page">
<app-navbar [currentstatus]="currentstatus" ></app-navbar>
<router-outlet></router-outlet>
<app-footer></app-footer>
</div>
</div>
here i have passed the currentstatus to navbar.component.ts
export class NavbarComponent implements OnInit {
@Input() currentstatus:any;
constructor(){
}
ngOnInit() {
}
logout(){
}
}
now how to pass this currentstatus to navbar.component.html???