So I want to hide the navbar while in a mobile view state. The navbar was created on a seperate component. Here is my admin.component.html like here:
<div *ngIf="!isMobile">
<div class="admin-container">
<!-- sidebar -->
<nav class="col-2 d-md-block sidebar collapse">
<div class="sidebar-sticky pt-3">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link" routerLink="/admin/dashboard"> Dashboard </a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/admin/orders"> Orders </a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/admin/adminProduct"> Products </a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/admin/reports"> Reports </a>
</li>
</ul>
</div>
</nav>
<!-- content -->
<div class="admin-content p-3">
<div
class="d-flex justify-content-end align-items-center pb-2 mb-2 border-bottom"
>
<form novalidate #loginForm="ngForm" (ngSubmit)="logout()">
<button type="submit" class="btn btn-juliet mt-3">Logout</button>
</form>
</div>
<router-outlet></router-outlet>
</div>
</div>
</div>
<div *ngIf="isMobile">
<div class="admin-container">
<!-- sidebar -->
<nav class="col-2 d-md-block sidebar collapse">
<div class="sidebar-sticky pt-3">
<ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link" routerLink="/admin/dashboard"> Dashboard </a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/admin/orders"> Orders </a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/admin/adminProduct"> Products </a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/admin/reports"> Reports </a>
</li>
</ul>
</div>
</nav>
<!-- content -->
<div class="admin-content p-3">
<div
class="d-flex justify-content-end align-items-center pb-2 mb-2 border-bottom"
>
<form novalidate #loginForm="ngForm" (ngSubmit)="logout()">
<button type="submit" class="btn btn-juliet mt-3">Logout</button>
</form>
</div>
<router-outlet></router-outlet>
</div>
</div>
</div>
Here is the admin.component.ts
import { Component, OnInit } from '#angular/core';
import { AuthService } from '../auth.service';
import { Router } from '#angular/router';
import { NavbarService } from '../services/navbar.service';
import { RibbonService } from '../services/ribbon.service';
import { ResponsiveService } from 'src/app/services/responsive.service';
import { FooterService } from '../services/footer.service';
#Component({
selector: 'app-admin',
templateUrl: './admin.component.html',
styleUrls: ['./admin.component.css'],
})
export class AdminComponent implements OnInit {
public isMobile: boolean;
constructor(
private authService: AuthService,
public nav: NavbarService,
public ribbon: RibbonService,
public footer: FooterService,
private router: Router,
private responsive: ResponsiveService,
) {}
ngOnInit(): void {
this.nav.hide();
this.ribbon.hide();
this.footer.hide();
this.onResize();
this.responsive.checkWidth();
}
logout() {
this.authService.clear();
this.router.navigate(['home']);
}
onResize() {
this.responsive.getMobileStatus().subscribe((isMobile) => {
this.isMobile = isMobile;
this.nav.hide();
});
}
}
And my app.component.html
<app-ribbon></app-ribbon>
<app-navbar></app-navbar>
<div class="app-body" (window:resize)="onResize()">
<router-outlet></router-outlet>
</div>
<app-footer></app-footer>
I tried applying *ngIf on the admin.component.html but the navbar won't go away. Thanks for the future answers!
Related
I have 2 nav pill buttons that are supposed to change the layout when clicked. Both layouts include the sidebar which doesn't change.
Nav pill 1 changes the layout to:
sidebar | column 1 | column 2
Nav pill 2 changes the layout to:
sidebar | col 1 | column 2 | col 3
Right now what happens is that one column will show up next to the sidebar but the others will be under it and i'm not sure why this happens
#sidebar {
/* width: 250px; */
min-height: 100vh;
max-height: 100vh;
}
#sidebar_sub_header a {
border-radius: 0;
}
#sidebar_main_content::-webkit-scrollbar {
width: 0;
height: 0;
overflow-y: scroll;
scrollbar-width: none;
-ms-overflow-style: none;
overflow-x: hidden;
}
#sidebar_main_content img {
/* border: 1px solid white; */
border: 1px solid rgba(255, 255, 255, 0.1);
height:100px;
width:100px;
}
#sidebar_footer {
align-items: center;
text-align: center;
}
#main_body_channels {
height: 100vh;
}
#main_body_token_requirement_confirmation {
height: 100vh;
}
#main_body_roles {
height: 100vh;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<div class="container-fluid px-0">
<div class="row gx-0">
<nav class="col p-0 d-flex flex-column gap-1 bg-dark text-white" id="sidebar">
<!-- sidebar header -->
<div class="bg-dark text-white p-3" style="text-align: center; align-items: center;">
<h4>
sidebar header
</h4>
<div class="dropup-center dropdown p-1">
<a href="#" class="align-items-center text-white text-decoration-none dropdown-toggle" id="dropdownUser1" data-bs-toggle="dropdown" aria-expanded="false">
username
</a>
<ul class="dropdown-menu dropdown-menu-dark text-small shadow" aria-labelledby="dropdownUser1">
<li><a class="dropdown-item" href="#">Delete User Info</a></li>
<li><a class="dropdown-item" href="#">Logout</a></li>
</ul>
</div>
</div>
<hr>
<!-- sidebar sub header -->
<div class="bg-dark text-white text-center" id="sidebar_sub_header">
<ul class="nav nav-pills flex-column mb-auto text-white" id="myTab" role="tablist">
<li class="nav-item" role="presentation">
<a href="#" class="nav-link text-white active" id="server_wide_button" data-bs-toggle="tab" data-bs-target="#server_wide_requirements_pane" type="button" role="tab" aria-controls="server_wide_requirements_pane" aria-selected="true">
button 1
</a>
</li>
<li class="nav-item" role="presentation">
<a href="#" class="nav-link text-white" id="channel_specific_button" data-bs-toggle="tab" data-bs-target="#channel_specific_requirements_pane" type="button" role="tab" aria-controls="channel_specific_requirements_pane" aria-selected="false">
button 2
</a>
</li>
</ul>
</div>
<br>
<!-- sidebar main content -->
<div class="flex-grow-1 overflow-auto bg-dark text-white" style="align-items: center;" id="sidebar_main_content">
<ul class="nav flex-column mb-auto align-items-center">
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle">
</a>
</li>
<br>
<li class="nav-item">
<a href="#" data-bs-toggle="tooltip" data-bs-placement="right" data-bs-title="test tooltip">
<img src="https://cdn.pixabay.com/photo/2020/02/10/11/12/smiley-4836191_1280.png" class="rounded-circle">
</a>
</li>
<br>
</ul>
</div>
<!-- sidebar footer -->
<div class="p-3 bg-dark text-white" id="sidebar_footer">
<a href="#" class="btn btn-primary" id="add_bot_button" role="button" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-custom-class="custom-tooltip" data-bs-title="test tooltip?">
test button
</a>
</div>
</nav>
<!-- TAB 1 -->
<div class="col tab-pane fade show active" id="server_wide_requirements_pane" role="tabpanel" aria-labelledby="server_wide_button" tabindex="0">
<div class="text-dark bg-danger" id="main_body_token_requirement_confirmation">
big main body column
</div>
<div class="p-0 d-flex flex-column gap-1 bg-secondary text-dark" id="main_body_roles">
right sidebar column
</div>
</div>
<!-- TAB 2 -->
<div class="col tab-pane fade" id="channel_specific_requirements_pane" role="tabpanel" aria-labelledby="channel_specific_button" tabindex="0">
<div class="p-0 bg-primary text-dark" id="main_body_channels">
column next to sidebar - same size?
</div>
<div class="bg-danger text-dark" id="main_body_token_requirement_confirmation">
big middle main body column
</div>
<div class="p-0 bg-secondary text-dark" id="main_body_roles">
right sidebar
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
using bootstrap 5.3.0 alpha-1
For Bootstrap tabs to work every tab-pane needs to be wrapped in a tab-content container.
For your columns; add the class container-fluid to each tab-pane, then add a row that contains your columns. In my basic example all columns are equal in width, but its easily adjustable.
I am assuming you want a full-page layout, so in CSS do:
#sidebar,
main {
height: 100vh;
max-height: 100vh;
}
Then give each container-fluid in <main> the class h-100, which is equal to height: 100%.
Next, give each row the class h-100. Add flex class align-items-stretch to make each column stretch the full available height.
Note: This snippet is build upon my answer of your previous question, not upon the code in your question.
#sidebar,
main {
height: 100vh;
max-height: 100vh;
}
.tab-pane .row .col {
background: tomato;
}
.tab-pane .row .col:nth-child(2) {
background: lightyellow;
}
<html>
<head>
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.3.0-alpha1/dist/js/bootstrap.bundle.min.js" integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN" crossorigin="anonymous"></script>
</head>
<body>
<div class="container-fluid px-0">
<div class="row gx-0">
<div class="col-4 d-flex flex-column gap-1 bg-dark text-white" id="sidebar">
<div class="p-2">
<h5>
Sidebar header
</h5>
</div>
<nav class="">
<ul class="nav nav-pills flex-column text-center" role="tablist" aria-orientation="vertical">
<li class="nav-link rounded-0 active" data-bs-toggle="tab" data-bs-target="#tab-1" type="button" role="tab" aria-controls="tab-1" aria-selected="true">Tab #1 - 2 Columns</li>
<li class="nav-link rounded-0" data-bs-toggle="tab" data-bs-target="#tab-2" type="button" role="tab" aria-controls="tab-2" aria-selected="false">Tab #2 - 3 Columns</li>
</ul>
</nav>
<div class="flex-grow-1 overflow-auto">
sidebar scroll
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
end sidebar scroll
</div>
<div class="">
Sidebar footer
</div>
</div>
<main class="col tab-content overflow-auto">
<div class="container-fluid h-100 tab-pane fade active show" id="tab-1" role="tabpanel" aria-labelledby="tab-1" tabindex="0">
<div class="row h-100 align-items-stretch">
<div class="col">
Col 1
</div>
<div class="col">
Col 2
</div>
</div>
</div>
<div class="container-fluid h-100 tab-pane fade" id="tab-2" role="tabpanel" aria-labelledby="tab-2" tabindex="0">
<div class="row h-100 align-items-stretch">
<div class="col">
Col 1
</div>
<div class="col">
Col 2
</div>
<div class="col">
Col 3
</div>
</div>
</div>
</main>
</div>
</div>
</body>
</html>
I have 2 issues with my ngx bootstrap navbar that will no doubtably be fixed with the same solution. My navbar has two different toggles separated with an ng-container whether the user is logged in or not. I created my navbar using the example in the docs
Now the issue I am having is the not logged in view does not have enough items for it to collapse when the screen size is reduced, so instead of it being a dropdown it is just a narrowed version.
not logged in full screen navbar:
not logged in small screen navbar:
now this could be bearable if it wasn't for the logged in version having much more nav links that get added in at log in. But when they get added in while the window is small the navbar doesn't collapse it just remains narrow (and actually goes off screen)
small screen then log in
when logged in, the navbar works correctly as intended for full screen and after logging in then reducing the screen size
logged in full screen
logged in small screen - closes into just a hamburger menu icon
However if the user is already logged in on page load in a small screen (tested with a hardcoded variable) then the navbar is collapsed correctly to be the hamburger menu/dropdown list. (I don't want to refresh the page as it defeats the purpose of having an angular app).
And what is even more interesting is if the user logs out while in the small screen then the navbar stays in its collapsed state.
So what I want is the navbar to go into that state while logged out.
template:
<nav ngxNavbarDynamicExpand class="navbar navbar-expand-lg">
<button class="navbar-toggler" type="button" (click)="collapse.toggle()">
<span><fa-icon [icon]="hamburger"></fa-icon></span>
</button>
<div class="container-fluid">
<ngx-navbar-collapse #collapse="ngxNavbarCollapse">
<a class="navbar-brand abs" href="https://example.com/">
<img width=auto
height="30px"
src="example.png"
alt=""
loading="lazy"sizes="(max-width: 1595px) 100vw, 1595px">
</a>
<ul class="navbar-nav me-auto mb-2 mb-md-0">
<li class="nav-item">
<a class="nav-link" routerLink="/" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" routerLink="/about" routerLinkActive="active">About</a>
</li>
</ul>
<ng-container *ngIf="(accountService.loggedIn$ | async); else notLoggedIn">
<div class="dropdown" dropdown>
<button class="dropdown-toggle text-light transparent-button ml-2" dropdownToggle>Admin</button>
<div class="dropdown-menu mt-3" *dropdownMenu>
<a routerLink="/" class="dropdown-item">1</a>
</div>
</div>
<div class="dropdown" dropdown>
<button class="dropdown-toggle text-light transparent-button ml-2" dropdownToggle>Manage</button>
<div class="dropdown-menu mt-3" *dropdownMenu>
<a routerLink="/userdetails" class="dropdown-item">My details</a>
</div>
</div>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" routerLink="/install" routerLinkActive="active">Install</a>
</li>
<li class="nav-item">
<button class="btn btn-primary"
routerLink="/"
(click)="logout()"
role="button">
<span class="d-none d-md-inline">Logout</span>
<fa-icon [icon]="faPowerOff" [classes]="['ml-md-2']"></fa-icon>
</button>
</li>
</ul>
</ng-container>
<ng-template #notLoggedIn>
<ul class="navbar-nav">
<li class="nav-item">
<button class="btn btn-primary"
routerLink="/login"
role="button">
<span class="d-none d-md-inline">Login/Register</span>
<fa-icon [icon]="faUser" [classes]="['ml-md-2']"></fa-icon>
</button>
</li>
</ul>
</ng-template>
</ngx-navbar-collapse>
</div>
</nav>
typescript:
import { Component, OnInit } from '#angular/core';
import { faPowerOff, IconDefinition, faBars, faUser } from '#fortawesome/free-solid-svg-icons';
import { AccountService } from '../services/account.service';
#Component({
selector: 'app-nav',
templateUrl: './nav.component.html',
styleUrls: ['./nav.component.css']
})
export class NavComponent implements OnInit {faPowerOff: IconDefinition = faPowerOff;
hamburger: IconDefinition = faBars;
faUser: IconDefinition = faUser;
constructor(public accountService : AccountService) { }
ngOnInit(): void {
}
logout(){
this.accountService.logout();
}
}
I want to active nav-bar menu when clicked from nav bar, i am using the following code, to active nav menu when clicked, but it is not working for me.
i am using bootstrap classes for add nav-bar into my webpage.
please help me to find where i am mistaken?
$(document).ready(function() {
$(".mr-auto .nav-item").bind("click", function(event) {
event.preventDefault();
var clickedItem = $(this);
$(".mr-auto .nav-item").each(function() {
$(this).removeClass("active");
});
clickedItem.addClass("active");
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<header id="main-header" class="header header1">
<nav class="navbar navbar-expand-lg navbar-light">
<a class="navbar-brand" href="./">
<img src="images/site-logo.png" alt="Site-logo">
</a>
<div id="toggle-icon" class="icon-btn">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
</div>
<div id="menu-nav" class="navigation-menu">
<div class="navbar-collap" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="./">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="about">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="careers">Careers</a>
</li>
<li class="nav-item">
<a class="nav-link" href="services">Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="portfolio">Portfolio</a>
</li>
<li class="nav-item contact-link">
<a class="nav-link" href="contact">Contact-us</a>
</li>
</ul>
<div class="button">
<a class="btn btn1" id="cont" href="contact.php">contact us <i class="icon-feature-6"></i></a>
</div>
</div>
</div>
</nav>
</header>
The .active class does not highlight the nav-link.
Solution 1
add css:
.mr-auto .nav-item.active a{background: blue;color:#fff}
Solution 2
Try this:
$(document).ready(function() {
$(".mr-auto .nav-item a").bind("click", function(event) {
event.preventDefault();
var clickedItem = $(this);
$(".mr-auto .nav-item a.active").removeClass("active btn-primary");
clickedItem.addClass("active btn-primary");
});
});
I have a navbar component with this code:
<ul class="navbar-nav mx-auto">
<li class="nav-item active">
<a class="nav-link" href="#" >Inicio <span class="sr-only"></span></a>
</li>
<li class="nav-item active">
<a class="nav-link" href="#">Here Link Home Section 2 <span class="sr-only"></span></a>
</li>
</ul>
and have another component HomeComponent with 3 sections:
<section id="home_one">
stuff
section
one
</section>
<section id="home_two">
stuff
section
two
</section>
<section id="home_three">
stuff
section
three
</section>
How can I link from navbar links to specific section (section 2) in another component (homeComponent)?
Angular 6.1 has new featured called anchorScrolling, Enable this option and use Router fragement
app.module.ts
#NgModule({
imports: [BrowserModule, FormsModule, RouterModule.forRoot(routes, {
anchorScrolling: 'enabled',
})],
declarations: [AppComponent, HelloComponent, ComponentbComponent],
bootstrap: [AppComponent]
})
app.component.html
<a [routerLink]="['item']" [fragment]="'section2'">
section2
</a>
<router-outlet></router-outlet>
Example:https://stackblitz.com/edit/angular-zgmsuw
In an angular way Its better for you to use Angular Router
Create Three components Instead of Sections
home_one
home_two
home_three
Then In your App Module Or in Seperate Routing Module declare you routes like:
const routes: Routes = [
{ path: 'home_one', component: home_one},
{ path: 'home_two', component: home_two },
{ path: 'home_three', component: home_three }
{ path: '', component: home }
{ path: '*', component: home }
];
Then In your Imports add routes
#NgModule({
imports: [RouterModule.forRoot(routes)],
})
Then In you 'Home page' or where ever you want to Render these sections Add Router Outlet, It will be something like this
<your-navbar-component></your-navbar-component>
<router-outlet></router-outlet>
In Your navbar configure your Anchor for your routes properly
<ul class="navbar-nav mx-auto">
<li class="nav-item " routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
<a class="nav-link" [routerLink]="['/home_one']" >Home One <span class="sr-only"></span></a>
</li>
<li class="nav-item " routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
<a class="nav-link" [routerLink]="['/home_two']" >Home Two<span class="sr-only"></span></a>
</li>
<li class="nav-item " routerLinkActive="active" [routerLinkActiveOptions]="{exact: true}">
<a class="nav-link" [routerLink]="['/home_three']" >Home Three<span class="sr-only"></span></a>
</li>
</ul>
For more Visit Official documentation:
https://angular.io/guide/router
If this is onclick of tabs and changing of corresponding section of tabs:-
.ts
tab = 'tab0';
.html
<ul class="navbar-nav mx-auto">
<li class="nav-item active" (click)='tab = "tab0"'>
<a class="nav-link" href="#" >Inicio <span class="sr-only"></span></a>
</li>
<li class="nav-item active" (click)='tab = "tab1"'>
<a class="nav-link" href="#">Here Link Home Section 2 <span class="sr-only"></span></a>
</li>
</ul>
<section id="home_one" *ngIf="tab ==='tab0'">
stuff
section
one
// Here you can pass selctor of a separate component for each section
// <tab0-component></tab0-component>
</section>
<section id="home_two" *ngIf="tab ==='tab1'">
stuff
section
two
</section>
<section id="home_three" *ngIf="tab ==='tab2'">
stuff
section
three
</section>
If you want to go to corresponding fragment onclick ie to scrollview in that document:-
Angular2 Routing with Hashtag to page anchor
If you want to change routes for each tab then:-
app.routing.ts
// create routes for each tab
.ts
constructor(public router:Router){
}
opentab(routes){
this.router.navigate[routes]
}
.html
<ul class="navbar-nav mx-auto">
<li class="nav-item active" (click)= 'opentab("tab0")'>
<a class="nav-link" href="#" >Inicio <span class="sr-only"></span></a>
</li>
<li class="nav-item active" (click)= 'opentab("tab1")'>
<a class="nav-link" href="#">Here Link Home Section 2 <span class="sr-only"></span></a>
</li>
</ul>
<router-outlet></router-outlet>
I have a parent component with bootstrap top navbar (with my custom css) template like this:
import { Component} from '#angular/core';
#Component({
selector: 'app-root',
template:'<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li routerLinkActive="active">
<a routerLink="home" translate><i class="fa fa-home"
aria-hidden="true"></i>Home</a>
</li>
<li routerLinkActive="active">
<a routerLink="home" translate><i class="fa fa-home"
aria-hidden="true"></i>Projects</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<app-translate></app-translate>
<li routerLinkActive="active">
<a href="#"><i class="fa fa-user-circle"
aria-hidden="true"></i>SignUp</a>
</li>
<li routerLinkActive="active">
<a href="#"><i class="fa fa-sign-in" aria-
hidden="true"></i>Login</a>
</li>
</ul>
</div>
</nav>',
styleUrls: ['./app.component.css']
})
export class AppComponent {
}
And this is my translate component:
#Component({
selector: 'app-translate',
template: ' <li routerLinkActive="active">
<a href="#" translate><i class="fa fa-user-circle" aria-
hidden="true"></i>test</a>
</li>',
styleUrls: ['./translate.component.css']
})
export class TranslateComponent {
}
In my app-translate component i want the achieve the normal behavior of a list, and apply all the bootstrap css and my custom css from parent component and add my own custon css to translate component. But the result is not as expected. How can i achieve this?