I am trying to hide some Content in in the UI using *ngif of angular4 its not working properly. can anybody help me on this. its value is not changing in the other component.
Navbar Template:
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav ml-auto mt-2 mt-md-0">
<li class="nav-item active">
<a class="nav-link" href="#">Dashboard</a>
</li>
<div *ngIf="saveSpinner==true" class="dropdown notificatio-dropdown">
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
aria-expanded="false"><span class="noti-icon ml-2"></span>Sample Data</a>
</li>
</div>
</ul>
</div>
Navbar Component: Here saveSpinner is set to false.
import {Component} from '@angular/core';
@Component({
selector: 'app-navbar',
templateUrl: './navbar.component.html',
styleUrls: ['./navbar.component.css']
})
export class NavbarComponent implements OnInit {
saveSpinner= false
ngOnInit() {
}
}
Dashboard template:
<app-navabar></app-navabar>
Dashboard Component: Here i am trying to change the value of saveSpinner to true. Its Not Changing. Here is the Code.
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.css']
})
export class DashboardComponent implements OnInit {
saveSpinner=true;
constructor() { }
ngOnInit() {
}
}
Can anybody help me how to change the value of saveSpinner in the DashboardComponent.