fail to install ui-bootstrap in angular-seed - angular-seed

I cloned the project and npm start successfully. However, when I want to npm install ui-bootstrap, it doesn't work.
➜ angular-seed git:(master) ✗ node -v
v10.15.3
➜ angular-seed git:(master) ✗ npm -v
6.4.1
<div class="dropdown" uib-dropdown auto-close="outsideClick">
<input type="text" uib-dropdown-toggle placeholder="请选择"/>
<i class="fa fa-caret-down quickmodel_arrow"></i>
<ul class="dropdown-menu" uib-dropdown-menu>
<li>
语文
</li>
<li>
数学
</li>
<li>
英语
</li>
</ul>

Related

Partial not running in .NET 7 when deployed to Azure

I'm running an ASP.NET Core 7 app that I've written. I've pretty much used the basics from a basic setup of a new ASP.NET Core app in Visual Studio 2022. When I run it locally, everything is working as intended. I've added a bit of code to the _LogonPartial.cshtml.
When I run it locally, I got everything running correctly.
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" href="/">BWDWeb</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" href="/">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="/Users/Pictures">Pics</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" href="/Privacy">Privacy</a>
</li>
</ul>
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link text-dark" title="Manage" href="/Identity/Account/Manage">Hello wallace.b.mcclure#gmail.com!</a>
</li>
<li class="nav-item">
<form class="form-inline" method="post" action="/Identity/Account/Logout">
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
<input name="__RequestVerificationToken" type="hidden" value="CfDJ8GZuOj8G4EJKpkUu0YwgwQUebAMzZHDWLJlpWl8yStyoJraAREx1GrNPYY-OwqrmMSnrko3UQ-8LV4XSBT4TFtwdJnNSfUl1vLWrh6CpIC9kyMbzvpUDVoOJDOQk5Tr7GmF3wdADP5Lo3OOmEsxcRl9Vl5u3bGFAUh52JGx2mgRVH9sFp3pcKSSmbaupMkq3wA" /></form>
</li>
</ul>
</div>
</div>
</nav>
</header>
When I run it in azure, I get this:
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<a class="navbar-brand" asp-area="" asp-page="/Index">BWDWeb</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="navbar-collapse collapse d-sm-inline-flex justify-content-between">
<ul class="navbar-nav flex-grow-1">
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Index">Home</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Users/Pictures">Pics</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Privacy</a>
</li>
</ul>
<partial name="_LoginPartial" />
</div>
</div>
</nav>
</header>
Here is the content of my _LogonPartial
#using Microsoft.AspNetCore.Identity
#using BWDWeb.Models
#inject SignInManager<ApplicationUser> SignInManager
#inject UserManager<ApplicationUser> UserManager
<ul class="navbar-nav">
#if (SignInManager.IsSignedIn(User))
{
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello #User.Identity?.Name!</a>
</li>
<li class="nav-item">
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="#Url.Page("/", new { area = "" })" method="post" >
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
</form>
</li>
}
else
{
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register">Register</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login">Login</a>
</li>
}
</ul>
I don't know why my code isn't running on Azure. I'm trying to figure out why. I've rebuilt, I've redeployed, and I've had no success.
I've created another web app in VS 2022, and deployed it, and everything works properly. I think the problem is somewhere in my code, but danged I can't see what I've mucked up and I don't know where to start. Any suggestions on how to get my _LogonPartial working again are appreciated.
I don't know why, but going into my publish settings, checking "Remove additional files at destination", and then redeploying has solved this problem for the moment. I did add the tagHelpers directives as suggested by #Mike Brind's link and redeployed previously, but that in and of itself didn't solve the problem. Doing both together seems to have solved the problem, though I do not know that adding the taghelpers lines into several files really did anything.
I also did a "clean" somewhere in the process this morning, but I think I had tried that yesterday to no avail. hopefully, someone can better explain what happened. Hopefully, the change the deployment settings and deleting the files will help someone else.

Vue 3 Bootstrap 5 Navbar not toggling back to minimized

Im using bootstrap 5 on vue 3 like by doing the below
npm install bootstrap
and importing it in main.js like
import "bootstrap/dist/css/bootstrap.min.css"
import "bootstrap"
import "bootstrap/dist/js/bootstrap.js"
and now in my components I have a nav
<nav class="navbar navbar-dark bg-dark navbar-expand-lg">
<div class="container container-fluid">
<a class="navbar-brand" href="/">Title</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navContent" aria-controls="navContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navContent">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" href="/">Home</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="/products">Products</a>
</li>
<li v-if="isAuth" class="nav-item float-end ms-md-auto">
<a class="nav-link active" v-on:click="showLogoutDialog">Logout</a>
</li>
</ul>
</div>
</div>
</nav>
And now the issue is that - I can toggle it to show the menu but cant toggle back. On looking into the inspect tool, I can see that the collapsing class gets applied but immediately disappears.
Thanks for any help in advance and please let me know if anything else is needed.
Eh.. solved it. So the issue is that if bootstrap gets included twice - the classes might not apply properly. So I had to remove the boostrap.js import. Now it works fine.
I also got facing the same problems. please run your project editing code with double quotes to single quotes.
Your code:
import "bootstrap/dist/css/bootstrap.min.css"
import "bootstrap"
import "bootstrap/dist/js/bootstrap.js"
my testing code:
import 'bootstrap/dist/css/bootstrap.min.css'
import 'bootstrap/dist/js/bootstrap.js'
import "bootstrap" **** Remove this line and run the server again and check

Problem while loading a Vue app on local machine, not getting the result as desired

Desired result
Result I'm getting
Header.vue code
<template>
<nav class="navbar navbar-default">
<div class="container-fluid">
<div class="navbar-header">
<router-link to="/" class="navbar-brand">Stock Trader</router-link>
</div>
<div class="collapse navbar-collapse" >
<ul class="nav navbar-nav">
<router-link to="/portfolio" activeClass="active" tag="li"><a>Portfolio</a></router-link>
<router-link to="/stocks" activeClass="active" tag="li"><a>Stocks</a></router-link>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>End day </li>
<li class="dropdown">
<a
href="#"
class="dropdown-toggle"
data-toggle="dropdown"
role="button"
aria-haspopup="true"
aria-expanded="false">Save & Load <span class="caret"></span></a>
<ul class="dropdown-menu">
<li>Save Data</li>
<li>Load Data</li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
</template>
Advise me if anything else is required.
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Stock Trader</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous"> -->
</head>
<body>
<div id="app">
</div>
<script src="/dist/build.js"></script>
</body>
</html>
enter image description here
Please advise: Problem while loading a Vue app on local machine, not getting the result as desired. I'm getting a warning however there is no CORS error once checking by pressing f12.
I've attached the third screenshot that shows warning
Please find the following code.
<template>
<div>
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<router-link class="nav-link" to="/">Stock Trader</router-link>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<router-link class="nav-link" to="/portfolio"
>Portfolio <span class="sr-only">(current)</span></router-link
>
</li>
<li class="nav-item">
<router-link class="nav-link" to="/stocks">Stocks</router-link>
</li>
</ul>
</div>
</nav>
</div>
</template>
Make sure that bootstrap is properly installed.
npm install --save bootstrap // install bootstrap
import in main.js file of vue by using the below import
import "bootstrap/dist/css/bootstrap.min.css"

menu will not un-collapse when click on button

I am really a newbie in bootstrap 3.
I have made this menu that will collapse when screen is resized, but nothing happend when I click on the button.
<button type="button" class="btn btn-navbar-highlight btn-lg btn-primary" data-toggle="collapse" data-target=".navbar-collapse" aria-expanded="false">
NAVIGATION <span class="icon-chevron-down icon-white"></span>
</button>
<div class="collapse navbar-collapse">
<ul class="nav nav-pills ddmenu">
<li class="dropdown active">Home</li>
<li class="dropdown">About</li>
<li class="dropdown">
Page <b class="caret"></b>
<ul class="dropdown-menu">
<li>Full Page</li>
<li>Two Column</li>
<li>Three Column</li>
<li>Documentation</li>
<li class="dropdown">
Dropdown Item »
<ul class="dropdown-menu sub-menu">
<li>Dropdown Item</li>
<li>Dropdown Item</li>
<li>Dropdown Item</li>
</ul>
</li>
</ul>
</li>
<li class="dropdown">Gallery</li>
<li class="dropdown">Contact</li>
</ul>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
What am I doing wrong?
Bootstrap's JavaScript requires jQuery version 1.9.1 or higher.
You can use version 1.12.0, which is the last one of the 1.X branch at the moment, and it should work :
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
Bootstrap should have notified you about this in your browser's javascript console directly, you should enable it as soon as you develop with projects that deal with JavaScript.

Glyphicon icons load locally but not in live

I have a slider made in bootstrap. The problem is the glyphicon icons are loaded properly in the local server, but not loaded in the live server.
<div id="carousel" class="carousel slide">
<ol class="carousel-indicators">
<li data-target="#carousel" data-slide-to="0" class="active"></li>
<li data-target="#carousel" data-slide-to="1"></li>
<li data-target="#carousel" data-slide-to="2"></li>
</ol>
<div class="carousel-inner">
<div class="item active">
<img src="<?php echo base_url('img/slide1.jpg'); ?>" alt="">
</div>
<div class="item">
<img src="<?php echo base_url('img/slide2.jpg'); ?>" alt="">
</div>
<div class="item">
<img src="<?php echo base_url('img/slide3.jpg'); ?>" alt="">
</div>
</div>
<a class="left carousel-control" href="#carousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
Most likely you have diferent website versions on you localhost and on production. Either you forgot to upload the fonts directory or any other bootstrap component, either you have diferent bootstrap versions for the two enviroments.
Manually navigate to all 4 font files on the production server and see what happens...do you get 404 or a download file? On my own server, in FireFox, I get a download prompt for each file except .svg. The .svg opens directly (but is empty white page, not an error).
Next, relative to the CSS files, where are they? Unless you've modified the paths manually, relative to your CSS file that's loaded in the browser, your font files should be up one directory, then in the fonts folder (../fonts/font-file.ext). Does your production server have any kind of auto-compiling/minification tools where you are loading the file from a location other than its original source?
Needless to say without paths to the actual offending location, there is no way for me to debug it based on your HTML.