import { Component, AfterViewInit } from '@angular/core'; import {Router } from '@angular/router' declare var $:any; @Component({ selector: 'header-plugin', templateUrl: './header-plugin.component.html', styleUrls: ['./header-plugin.component.css'] }) export class HeaderPluginComponent implements AfterViewInit { constructor(private router: Router) { } ngAfterViewInit() { $('.ui.dropdown').dropdown({ // you can use any ui transition transition: 'drop' }); } OnSettings(){ localStorage.setItem("lastVisit",this.router.url); this.router.navigateByUrl('/settings'); } OnChangePassword(){ this.router.navigateByUrl('/main/change-password'); } OnLogout(){ $('.ui.dropdown') .dropdown('hide') ; localStorage.removeItem('sessionId'); this.router.navigateByUrl('/login'); } menuSidebar(){ $('.ui.sidebar').sidebar('toggle'); } }