How to use material icon in angular 2? - angular2-template

I am trying to use below code. But home icon is not getting displayed.
<button md-button routerLink="/">
<md-icon>home</md-icon>
</button>

Add the angular material icon link in index.html
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Related

auth0 quickstart menu collapses but does not open

I just downloaded the auth0 quickstart vanilla JS single page application. The menu that you get when you resize the app, does not work.
instead, you get a error that says the collapse.js has a object error.
Okay, this should save some time to other folks who are using auth0.
The problem is here, in the second line.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.5.0.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
For some reason, jquery-3.5.0 has some problems with the dropdown menu working. The following worked for me.
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<script
src="https://code.jquery.com/jquery-3.4.1.slim.js"
integrity="sha256-BTlTdQO9/fascB1drekrDVkaKd9PkwBymMlHOiG+qLI="
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
I am using 3.4.1 jQuery (second line again, above). That got the menu working.

How to add icon to title bar

I am trying to make web application and i need to add an icon to my title bar with a name.
I am making the web application using empty project in MVC with web form included. I am doing the coding using Visual studio 2017. I have tried my layout as below so far.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<link href="~/Content/nav.css" rel="stylesheet" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="icon" type="image/svg" href="~/Content/img/download.png" />
<script src="~/Scripts/layout.js"></script>
<title>#ViewBag.Title</title>
</head>
<body>
<navbar>
<div class="topnav" id="myTopnav">
Home
Login
Payment
Customer Registration
<a href="javascript:void(0);" class="icon" onclick="myfunction()">
<i class="fa fa-bars"></i>
</a>
</div>
<div>
#RenderBody()
</div>
</navbar>
</body>
</html>
I have tried to link the image before title but it took a wrong turn. Since I am new to MVC, please give me some method to add an icon to title bar.
What you are looking for is called a favicon. You can generate it from png or whatever and then include it in your page like this:
<link rel="icon" href="/favicon.ico" type="image/x-icon">
Here's a favicon generator (one of many):
https://www.favicon-generator.org/
The problem lays in this code:
<link rel="icon" type="image/svg" href="~/Content/img/download.png" />
You are specifying that the type is image/svg while instead it is a image/png.
Be sure that a png image exists in Content/img folder.

Summernote WYSIWYG Editor is not visible

I want to use Summernote editor in a popup that is inside a popup,the popup code is inside the partial view. And i have included the css & js files in the main view but when i click on the editor button popup comes but i am not able to see the editor.I have searched a lot and not able to figure out what can be the issue.Is it because of the popup ??
Look at this demo I created just now-
http://jsfiddle.net/gze70ov2/1/
First initialize summernote on document ready.
And make sure you have included required resources for this to work in order-
<link href="font-awesome.css" rel="stylesheet"/>
<link href="bootstrap.css" rel="stylesheet"/>
<link href="summernote.min.css" rel="stylesheet"/>
<script src="jquery.js" type="text/javascript"></script>
<script src="bootstrap.min.js" type="text/javascript"></script>
<script src="summernote.min.js" type="text/javascript"></script>

Lightbox 2 redirects me to the image file

I have a problem with lightbox. After clicking the image file it just redirects me to the image.
This is the code in the cshtml.
<a href="" data-lightbox="screenshot" >
<img src="" />
</a>
The href and src's values are automatically being inserted by a jquery code and is guaranteed to be the same image. The styles and scripts that are necessary are also inserted.
<script src="../../Scripts/jquery-1.11.0.min.js" ></script>
<script src="../../Scripts/lightbox.min.js" type="text/javascript"></script>
<link href="../../Styles/lightbox.css" rel="stylesheet" type="text/css" />
How do I view the image using lightbox instead of it redirecting? I followed the instructions in this link but it still did not work: http://lokeshdhakar.com/projects/lightbox2/
Put the
<script src="../../Scripts/lightbox.min.js" type="text/javascript"></script>
line at the end, before the closing /body

X-editable helloworld

I am trying to workout a HelloWorld example of Bootstrap3 and X-editable. I am attaching my page source code in this post. I am facing two issues.
I am getting the following error when i use mode as 'popup' as soon as i click on the editable link.
TypeError: this.getCalculatedOffset is not a function
If i switch from popup to inline at-least the page appears however, the buttons dont appear correctly.
Any feedback would be appreciated. Page Source is below:-
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>X-Editable Bootstrap Hello World!</title>
<link rel="stylesheet" href="twitter-bootstrap/css/bootstrap.css" type="text/css"/>
<link href="bootstrap-editable/bootstrap3-editable/css/bootstrap-editable.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h1>Hello World Bootstrap</h1>
<div class="hero-unit">
<p>Hey.. this is my very first XEdit-able Bootstrap site.</p>
<!-- superuser -->
superuser
</div>
</div>
<script src="http://code.jquery.com/jquery-2.0.3.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script src="twitter-bootstrap/js/bootstrap.js"></script>
<script src="bootstrap-editable/bootstrap3-editable/js/bootstrap-editable.js"></script>
<script type="text/javascript">
$.fn.editable.defaults.mode = 'inline';
$(document).ready( function(){
//$('#username').editable();
$('#username').editable( {
type: 'text',
pk: 1,
url: '/post',
title: 'Enter username'
});
} );
</script>
</body>
</html>
Your bootstrap css and js files must be from 2.xx version of bootstrap, that's a problem.
Use x-editable for bootstrap 2 or update your bootstrap to version 3+.
I had the same issue after upgrading from Bootstrap 2 to Bootstrap 3.
I had upgraded Bootstrap's CSS, X-Editable's CSS and JS, but had forgotten to upgrade Bootstrap's JS which was still for v2.
Don't forget to update all files:
Bootstrap 3 .css and .js
X-Editable for Bootstrap 3 .css and .js
Probably a bit late, but hopefully that can still help someone.