Having issues getting Angular Routing to work properly - html

I'm pretty sure I have the routing setup correctly within my application because when I type the correct path it takes me to and displays the correct information. Where I am having issues is the router link. I believe it has something to do with the HTML? When I click on each link nothing happens. Anyways I will post the HTML to see if someone can point out something I may be doing wrong. I've also got the github repository link here: https://github.com/jadenadams329/JIT1
<div class="app-bar-navbar vertical-appbar">
<nav class="navbar navbar-expand-lg navbar-dark bg-primary app-bar-section pr-0 d-flex justify-content-start">
<button class="navbar-toggler1 m-0 focusable" (click)="displaySideNav =!displaySideNav;" (blur)="displaySideNav = false">
<i class="icon-menu-bold"></i>
</button>
<span class="vertical-line-seperator left"> </span>
<div class="navbar-brand d-flex align-items-center">
<img src="assets/images/logo/secondary-logo-site.svg" class="logo-img">
<!-- <i class="icon-bd-logo-bold"></i> -->
<span class="brand-name">JIT Management Console</span>
</div>
<div class="navbar-right-content justify-content-end d-flex">
<div class="navbar-right-toggle d-flex">
<ul class="navbar-nav">
<li class="nav-item dropdown-appbar d-flex">
<span class="vertical-line-seperator left"> </span>
<a class="nav-link navbar-toggler" id="navbarDropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="icon-more-bold text-white rotate-90"></i>
</a>
<ul class="dropdown-menu pull-right" aria-labelledby="dLabe2">
<li role="separator" class="dropdown-divider"></li>
<li class="nav-item">
Sign Out
</li>
</ul>
</li>
</ul>
</div>
<div class="custom-dropdown d-flex">
<ul class="navbar-nav">
<li class="nav-item dropdown-appbar d-flex">
<span class="vertical-line-seperator left"> </span>
<a class="nav-link dropdown-toggle" id="navbarDropdownMenuLink" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Admin
</a>
<ul class="dropdown-menu pull-right" aria-labelledby="dLabe2">
<li>
Sign Out
</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
<section class="vertical-sidebar collapse navbar-collapse justify-content-end" id="navbarSidebarContent-main"
[ngClass]="{'show':displaySideNav}">
<nav class="nav">
<ul class="sidebar-links">
<li>
<a routerLink="/home">Home</a>
</li>
<li>
<a routerLink="/manage-sessions">Manage Sessions</a>
</li>
<li>
<a routerLink="/export-scancodes">Export ScanCodes</a>
</li>
<li>
<a routerLink="/imu-data">IMU Data</a>
</li>
<li>
<a routerLink="/global-order-days">Global Order Days</a>
</li>
<li>
<a routerLink="/order-exception-report">Order Exception Report</a>
</li>
</ul>
</nav>
</section>
</div>
<div>
<router-outlet></router-outlet>
</div>
What I expect to happen is when I click on the links that it shows the correct view so I do not have to type in the path each time.

You have blur event in button element. Currently It's removing the section element whenever you are focused out of button. remove that blur event from button and place click event on ui element and set the displaySidenav to false.
<button class="navbar-toggler1 m-0 focusable" (click)="displaySideNav =!displaySideNav;" >
<i class="icon-menu-bold"></i>
</button>
<ul class="sidebar-links" (click)="displaySideNav = false">
<li>
<a routerLink="/home">Home</a>
</li>
<li>
<a routerLink="/manage-sessions">Manage Sessions</a>
</li>
<li>
<a routerLink="/export-scancodes">Export ScanCodes</a>
</li>
<li>
<a routerLink="/imu-data">IMU Data</a>
</li>
<li>
<a routerLink="/global-order-days">Global Order Days</a>
</li>
<li>
<a routerLink="/order-exception-report">Order Exception Report</a>
</li>
</ul>

Related

Collapse menu in menuBar (Home section)

I have a problem creating the bootstrap collapse menu.
<div className='collapse' id='mobile-menu'>
<button
clasNames='navbar-toggler'
type='button'
data-toggle='collapse'
data-target='#navbarToggleExternalContent'
aria-controls='navbarToggleExternalContent'
aria-expanded='false'
aria-label='Toggle navigation'
>
<span className='navbar-toggler-icon'></span>
</button>
<div className={clsx('col-auto order-sm-1', styles.menu)} id='mobile-menu'>
<ul>
<li>
<a href='#' className={styles.active}>
Home
</a>
</li>
<li>
<a href='#'>Furniture</a>
</li>
<li>
<a href='#'>Chair</a>
</li>
<li>
<a href='#'>Table</a>
</li>
<li>
<a href='#'>Sofa</a>
</li>
<li>
<a href='#'>Bedroom</a>
</li>
<li>
<a href='#'>Blog</a>
</li>
</ul>
</div>
</div>
It should be hidden only for xs size. In button and user should be possible to open in and see all menu bar. I used bootstrap documents and I don't know how to do it correctly
You need to review the navbar docs for version 5 as the data attribute names have changed from data-* to data-bs-*. You are also targeting the wrong element data-target='#navbarToggleExternalContent' that should be data-bs-target="#mobile-menu". Also you have duplicate id='mobile-menu' elements (invalid HTML).
You want something more like the following:
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<nav class="navbar navbar-expand-sm bg-light" id="mobile-menu-wrapper">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mobile-menu" aria-controls="mobile-menu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="mobile-menu">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Furniture</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Chair</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Table</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Sofa</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Bedroom</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Blog</a>
</li>
</ul>
</div>
</div>
</nav>
<script src="https://cdn.jsdelivr.net/npm/bootstrap#5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>

Bootstrap 4 navbar/menu keep entry visible when collapsed

This is a question similar to this one, but it is for Bootstrap 4.
I am not able to add right-justified entries on the BS4 navbar that stay visible both when collapsed and not collapsed. I spent one full afternoon without success.
This is my goal:
Here my current code (that works only when not collapsed):
<nav class="navbar navbar-light navbar-expand-xl border-bottom mainmenu sticky-top">
<a class="navbar-brand text-capitalize text-blur" href="/">
<img class="mr-1" src="/images/logo/favicon-32x32.png" alt="Logo">
<span class="">Portami in Pista</span>
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#myTopMenu"
aria-controls="collapsableTopMen" aria-expanded="false" aria-label="[Menu]">
<span class="sr-only">[Menu]</span>
<span class="navbar-toggler-icon" title="[Menu]"/>
</button>
<div class="collapse navbar-collapse" id="collapsableTopMen">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="/Schools/">
<i class="fa fa-motorcycle fa-rotate-315 text-danger" aria-hidden="true"/>
<span class="text-blur-danger">PiP Reparto Corse</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/Tracks/">
<i class="fa fa-flag-checkered text-primary" aria-hidden="true"/>
<span>Piste</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/Blog/le-guide-del-giovedi/">
<i class="fa fa-mortar-board text-primary" aria-hidden="true"/>
<span>Le guide del giovedì</span>
</a>
</li>
</ul>
<ul class="navbar-nav ml-auto">
<!- START of section should be always visible -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownLang" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="famfamfam-flags it" title="Italiano"/>
<span class="d-inline d-xl-none">Italiano</span>
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownLang">
<a class="dropdown-item" href="/AbpLocalization/ChangeCulture?cultureName=en&returnUrl=/">
<i class="famfamfam-flags gb" aria-hidden="true"/>
<span class="">English</span>
</a>
</div>
</li>
<!- END of section should be always visible -->
<li class="nav-item">
<a class="nav-link" href="/Account/Login"><i class="fa fa-sign-in"/> Log in</a>
</li>
</ul>
</div>
</nav>
Since you're using Bootstrap 4, this answer is more relevant to your question:
https://stackoverflow.com/a/41513784/171456 (see the last part)
The part that you always want to keep visible needs to be separate from any of the collapsible parts. Then use the order-* classes to position the items as desired:
Demo: https://codeply.com/p/ylDhhZtpiH
<nav class="navbar navbar-light navbar-expand-xl border-bottom mainmenu sticky-top justify-content-start">
<a class="navbar-brand text-capitalize text-blur" href="/">
<img class="mr-1" src="//placehold.it/32" alt="Logo">
<span class="">Portami in Pista</span>
</a>
<button class="navbar-toggler order-2 ml-1" type="button" data-toggle="collapse" data-target=".collapsable" aria-controls="collapsableTopMen" aria-expanded="false" aria-label="[Menu]">
<span class="sr-only">[Menu]</span>
<span class="navbar-toggler-icon" title="[Menu]"></span>
</button>
<!-- 1st collapse menu -->
<div class="collapse navbar-collapse collapsable flex-grow-0 flex-xl-grow-1 order-last" id="collapsableTopMen">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="/Schools/">
<i class="fa fa-motorcycle fa-rotate-315 text-danger" aria-hidden="true"></i>
<span class="text-blur-danger">PiP Reparto Corse</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/Tracks/">
<i class="fa fa-flag-checkered text-primary" aria-hidden="true"></i>
<span>Piste</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/Blog/le-guide-del-giovedi/">
<i class="fa fa-mortar-board text-primary" aria-hidden="true"></i>
<span>Le guide del giovedì</span>
</a>
</li>
</ul>
</div>
<!-- always visible portion -->
<ul class="navbar-nav order-1 order-xl-last ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownLang" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-flag it" title="Italiano"></i>
<span class="d-inline d-xl-none">Italiano</span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownLang">
<a class="dropdown-item" href="#">
<i class="fas fa-flag-usa gb" aria-hidden="true"></i>
<span class="">English</span>
</a>
</div>
</li>
</ul>
<!-- 2nd collapse menu -->
<div class="collapse navbar-collapse collapsable flex-grow-0 order-last">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/Account/Login"><i class="fa fa-sign-in"></i> Log in</a>
</li>
</ul>
</div>
</nav>
https://codeply.com/p/ylDhhZtpiH
I did a small important fix to the good answer from Zim.
I fixed the "always visible" portion of the menu as he did not overlap the whole menu when it was collapsed.
Adding a custom .navbar-always-overlapped class, fixed it.
<nav class="navbar navbar-light navbar-expand-lg border-bottom mainmenu sticky-top justify-content-start">
<!-- same code from Zim here>
...
<!-- always visible portion. Note the 'navbar-always-overlapped' -->
<ul class="navbar-nav navbar-always-overlapped order-1 order-lg-last ml-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownLang" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fas fa-flag it" title="Italiano"></i>
<span class="d-inline d-lg-none">Italiano</span>
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownLang">
<a class="dropdown-item" href="#">
<i class="fas fa-flag-usa gb" aria-hidden="true"></i>
<span class="">English</span>
</a>
</div>
</li>
</ul>
<!-- 2nd collapse menu -->
<div class="collapse navbar-collapse collapsable flex-grow-0 order-last">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/Account/Login"><i class="fa fa-sign-in"></i> Log in</a>
</li>
</ul>
</div>
</nav>
and the code for .navbar-always-overlapped:
.navbar-always-overlapped .dropdown-menu {
position: absolute !important;
}
See https://codeply.com/p/9deLYTGblZ

How to make make navbar responsive, using a template

I'm using a colorlib template called faithful: https://colorlib.com/wp/template/faithful/
Basically I changed the css and the navbar to a horizontal one, the problem is when I view it in mobile, it doesn't work
This is what I did to change the navbar to a horizontal one
<div class="site-navbar-wrap js-site-navbar bg-white">
<div class="container">
<div class="site-navbar bg-light">
<div class="py-1">
<div class="row align-items-center">
<div class="col-2">
<a class="d-block" href="index.html" rel="home"><img class="d-block" src="images/company_logo.png" alt="logo"></a>
</div>
<div class="col-10">
<nav class="navbar navbar-default" role="navigation">
<div class="navbar-header">
<ul class="navbar-default" id="menu">
<li class="active">
Home
</li>
<a class="dropdown-toggle fa" data-toggle="dropdown" href="about.html" >About Us<span></span></a>
<ul class="dropdown-menu">
<li>Our Company</li>
<li>Team</li>
<li>Goals</li>
<li>Location</li>
</ul>
<li>Products</li>
</li>
<li>Merchandise</li>
<li>FAQs</li>
<li>Contact Us</li>
</ul>
</div>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
I want the navbar to work on mobile (showing a button on the right)
I tried everything I could but it still doesn't work and I've already finished the design of the website, I just really need to change the navbar.
<nav class="navbar navbar-expand-lg navbar-dark primary-color">
<!-- Collapse button -->
<button class="navbar-toggler float-xs-right" type="button" data-toggle="collapse" data-target="#basicExampleNav"
aria-controls="basicExampleNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Collapsible content -->
<div class="collapse navbar-collapse" id="basicExampleNav">
<!-- Links -->
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Our company</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">team</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">goals</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">location</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">products</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">merchandise</a>
</li>
</ul>
</div>
</nav>
you can modify and use this

Make link clickable, but also have the dropdown?

I have an navigation bar, where I have an "nav-item" with a dropdown function.
But what I want is the "button / nav-item", that is visible in the navb-bar to be clickable and have a redirect to another page, and then the dropdown arrow should be on the right side, where you can click on the arrow and then get the dropdown menu.
I have two approaches:
1.
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" />
<nav class="navbar navbar-expand-md bg-dark navbar-dark">
<!-- Navbar Toggle -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Navbar Toggle END -->
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<!-- Navbar Items Links-->
<ul class="navbar-nav">
<!-- Home -->
<li class="nav-item">
<a class="nav-link" href="../Startseite/Index.jsp">Home <i class="fas fa-home"></i></a>
</li>
<!-- Gruppen Dropdown-->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#gruppen" id="navbardrop1" data-toggle="dropdown">Gruppen <i class="fas fa-users"></i></a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#gruppe1">Gruppe 1</a>
<a class="dropdown-item" href="#gruppe2">Gruppe 2</a>
<a class="dropdown-item" href="#gruppe3">Gruppe 3</a>
</div>
</li>
<!-- Zahlungen -->
<li class="nav-item"><a class="nav-link" href="../Zahlungsuebersicht/Zahlungsuebersicht.jsp">Zahlungen
<i class="fas fa-receipt"></i>
</a></li>
</ul>
<!-- Navbar Items Rechts-->
<ul class="navbar-nav ml-auto">
<!-- Profil -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#asd" id="navbardrop2" data-toggle="dropdown">Benutzer <i class="fas fa-user"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="#asd">Profil bearbeiten <i
class="fas fa-user-edit"></i>
</a> <a class="dropdown-item" href="#asd">Abmelden <i class="fas fa-sign-in-alt"></i>
</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link active" href="../Registrieren/Registrieren.jsp">Registrieren <i class="fas fa-sign-in-alt"></i></a>
</li>
</ul>
<!-- Navbar Items END -->
</div>
</nav>
This one is from the design what I am looking for, but I would like the element "Gruppen" clickable, so it redirects you to another page.
2
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" />
<nav class="navbar navbar-expand-md bg-dark navbar-dark">
<!-- Navbar Toggle -->
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
<span class="navbar-toggler-icon"></span>
</button>
<!-- Navbar Toggle END -->
<div class="collapse navbar-collapse" id="collapsibleNavbar">
<!-- Navbar Items Links-->
<ul class="navbar-nav">
<!-- Home -->
<li class="nav-item">
<a class="nav-link" href="../Startseite/Index.jsp">Home <i class="fas fa-home"></i></a>
</li>
<!-- Gruppen Dropdown-->
<li class="nav-item">
<a class="nav-link" href="#gruppen">Gruppen <i class="fas fa-home"></i></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbardrop1" data-toggle="dropdown"></a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#gruppe1">Gruppe 1</a>
<a class="dropdown-item" href="#gruppe2">Gruppe 2</a>
<a class="dropdown-item" href="#gruppe3">Gruppe 3</a>
</div>
</li>
<!-- Zahlungen -->
<li class="nav-item"><a class="nav-link" href="../Zahlungsuebersicht/Zahlungsuebersicht.jsp">Zahlungen
<i class="fas fa-receipt"></i>
</a></li>
</ul>
<!-- Navbar Items Rechts-->
<ul class="navbar-nav ml-auto">
<!-- Profil -->
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#asd" id="navbardrop2" data-toggle="dropdown">Benutzer <i class="fas fa-user"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" href="#asd">Profil bearbeiten <i
class="fas fa-user-edit"></i>
</a> <a class="dropdown-item" href="#asd">Abmelden <i class="fas fa-sign-in-alt"></i>
</a>
</div>
</li>
<!-- /c:if -->
<li class="nav-item">
<a class="nav-link active" href="../Registrieren/Registrieren.jsp">Registrieren <i class="fas fa-sign-in-alt"></i></a>
</li>
</ul>
<!-- Navbar Items END -->
</div>
</nav>
This one solution is really dirty in my opinion.
Isn't there a clean way to achieve a proper solution?
I'm pretty new to all HTML, Bootstrap and CSS.
EDIT: I have no idea why, but i have run the two exact same code snippets on my local server, and the outcome was different... I want it to like the second approach, but without the arrow being a navitem by it's own, but when I do it, the dropdown arrow is at the top of the navbar, like above all the text. is there a way to fix that?
Your current code structure simplified:
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbardrop1" data-toggle="dropdown">
Gruppen <i class="fas fa-users"></i>
</a>
<div class="dropdown-menu">
...
</div>
</li>
As I understood - the aim is to make <i class="fas fa-users"></i> a separate dropdown link and the style should not degrade.
This will solve your issue:
<li class="nav-item dropdown nav-link">
<a href="/#yourlink">
Gruppen
</a>
<a class="dropdown-toggle" href="#" id="navbardrop1" data-toggle="dropdown">
<i class="fas fa-users"></i>
</a>
<div class="dropdown-menu">
...
</div>
</li>
The trick is in the nav-link class, which makes the propper positioning of your menu element. Moving it to the <li> element may have caused some conflicts in styles if the CSS was more complex, so be careful with moving class from one element to another in future.
Note: you must understand that the dropdown menu should not be made the way you want them now, because interacting with it the average user expects a dropdown after the click, not the redirect to some external page.

Angular/Bootstrap - Navbar with toggleable sidebar

Im trying to build a progressive web-app with Angular and Bootstrap. The most challenging part is to implement a navbar that looks good on the web and on the mobile view. For the most part I'm pretty happy with my implementation so far. See Link on Stackblitz
But now I am trying to toggle the navbar as a Sidebar, that opens up from the right to the left. Additionally the sidebar should push the content (Placeholder-Text) to the left. This could be kind of tough, because that perhaps means modifying some Bootstrap classes. Maybe some of you have a solution for this. Currently my navbar toggles the links underneath.
html
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<ul class="navbar-nav">
<li class="nav-item">
<a class="navbar-brand d-none d-md-block" href="javascript:void(0)">
<img alt="logo" src="https://..." width="40px" height="auto">
My Brand
</a>
</li>
</ul>
<ul class="navbar-nav mr-auto mr-md-3">
<li class="nav-item">
<a class="nav-link font-weight-bold" href="javascript:void(0)">Stories</a>
</li>
</ul>
<ul class="navbar-nav mr-auto mr-md-3">
<li class="nav-item">
<a class="nav-link" href="javascript:void(0)">
<span>
<img class="rounded" src="https://..." alt="user" width="35" height="35">
<span class="d-none d-lg-inline"> Tommy</span>
</span>
</a>
</li>
</ul>
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link font-weight-bold" href="javascript:void(0)">
<div class="img-container" (click)="notificationsViewed = true">
<img alt="notifications" src="https://..." width="35">
<span [hidden]="notificationsViewed" class="badge badge-danger notifications-count">{{3}}</span>
</div>
</a>
</li>
</ul>
<button class="navbar-toggler" (click)="toggleNavbar()" type="button" [attr.aria-expanded]="!isCollapsed">
<span class="icon-bar top-bar"></span>
<span class="icon-bar middle-bar"></span>
<span class="icon-bar bottom-bar"></span>
</button>
<div class="collapse navbar-collapse" [ngClass]="{ 'show': isCollapsed }">
<ul class="navbar-nav float-right ml-auto">
<li class="nav-item">
<a class="nav-link font-weight-bold" href="javascript:void(0)">About Us</a>
</li>
<li class="nav-item">
<a class="nav-link font-weight-bold"href="javascript:void(0)">Policy</a>
</li>
<li class="nav-item">
<a class="nav-link font-weight-bold" href="javascript:void(0)">Contact</a>
</li>
<li class="nav-item">
<button (click)="logout()" class="btn btn-bd-logout">
Logout
</button>
</li>
</ul>
</div>
</nav>
Typescript
public isCollapsed: boolean = false;
toggleNavbar() {
this.isCollapsed = !this.isCollapsed;
}
I didn't understand second part the sidebar should push the content (Placeholder-Text) to the left.
But for the first part for Sidebar try using Angular Material Navigation Option :
Angular Material Sidenav