Html 需要在不使用“导航”的情况下加载侧导航条;window.location.reload();棱角分明
我无法在此方法中加载导航栏,但window.location.reload()工作正常,但我不想重新加载整个应用程序Html 需要在不使用“导航”的情况下加载侧导航条;window.location.reload();棱角分明,html,css,angular,typescript,Html,Css,Angular,Typescript,我无法在此方法中加载导航栏,但window.location.reload()工作正常,但我不想重新加载整个应用程序 maximizeClick(event) { let status = event.currentTarget.checked; if (status == false) { $('body').addClass("nav-function-minify"); let minandmax = 0; var o
maximizeClick(event) {
let status = event.currentTarget.checked;
if (status == false) {
$('body').addClass("nav-function-minify");
let minandmax = 0;
var obj = {
userid: +this.userid,
minandmax: minandmax
}
if (this.userPreferenceStatus) {
this.commonService.postuserpreference(obj).subscribe(res => {
this.getuserPreferences();
this.toastr.success('preference added successfully');
}, err => {
this.toastr.error('error in geting ser preferences');
})
}
else {
this.commonService.UpadateUserPreferences(obj, 'minandmaxupdate').subscribe(res => {
this.getuserPreferences();
this.toastr.success('preference updated successfully');
**window.location.reload();**
}, err => {
this.toastr.error('error in geting ser preferences');
})
}
}}
请提供您的想法,guysI可能不知道,但是您可以删除Minify类并添加备用类,使用.removeClass(Minify).removeClass(maximize).addClass(maximize)?GALI,通常您应该始终具有导航栏。如果您想更改导航栏的某些内容,您可以使用服务,订阅导航栏中的主题并从组件中发出值:(确实标题很糟糕,Theccica用于通信两个组件-不一定是父子关系。注意:要更改类,您可以使用
[ngClass]
: