Thursday, 7 January 2021

Load same component/Refresh same component

 

Load same component/Refresh same component in angular

loadSameUrl() {

  let currentUrl = this._router.url; // current url import router module inside constructor

  this._router.navigateByUrl('/', {skipLocationChange: true}).then(() => {

      this._router.navigate([currentUrl]);

  });

}

Wednesday, 19 February 2020

Dot animation/ dot point zoom, point animation

<!DOCTYPE html>
<html>
<head>
  <title></title>
</head>
<body>


<style>

.mycircle-blink {
  width: 8px;
  height: 8px;
  background: #f83306;
  position: relative;
   transform: scale(1.0);
  animation: blink 2s infinite;
    transition-timing-function: linear;
    border: solid 3px rgba(255, 165, 0, 0.8);
    border-radius: 50%
}


@keyframes motion {
  0% {
     /* transform: scale(1.5);*/
      left:0px; top:0px;
     
  }
 

 25% {
    /* transform: scale(1.0);*/
      left:25px; top:25px;
  }

   50% {
    /* transform: scale(1.0);*/
      left:50px; top:50px;
  }


     75% {
    /* transform: scale(1.0);*/
      left:75px; top:75px;
  }



  100% {
     /* transform: scale(1.5);*/
      left:0px; top:0px;

  }
}

@keyframes blink {
    0%  {transform: scale(1.0); }
    20% {transform: scale(1.5); }
    40% {transform: scale(1.0); }
    60% {transform: scale(1.5); }
    80% {transform: scale(1.2); }
    90% {transform: scale(1.3); }
    100%{transform: scale(1.1); }
  }

</style>


<div class="mycircle-blink"></div>

</body>
</html>

Thursday, 30 January 2020

Sample Login html, Login HTML, Forgot password HTML







<!doctype html>
<html lang="en">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <meta name="keywords" content="....">
    <meta name="description" content="....">
    <link rel="icon" type="image/x-icon" href="images/fevicon.png">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.css" />
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
      <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
      -->

      <style type="text/css">

        /* Important things:
         1). Include bootstrap.css 
         2). Below all  copy to external css page */


          @import url('https://fonts.googleapis.com/css?family=Anton|Archivo+Black|Didact+Gothic|Fredoka+One|Gelasio:400,400i,500,500i,600,600i,700,700i|Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i|Oswald:200,300,400,500,600,700|Questrial|Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i|Source+Sans+Pro:200,200i,300,300i,400,400i,600,600i,700,700i,900,900i&display=swap');
@import url('https://fonts.googleapis.com/css?family=Montserrat:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i');

/*@import url('main.css');
@import url('font-awesome/css/all.css');
@import url('font-awesome/css/font-awesome.min.css');*/


body{
background-color: #ccc;
/*font-family: 'Roboto', sans-serif;
font-family: 'Gelasio', serif;*/
font-family: 'Montserrat', sans-serif;
/*font-family: 'Source Sans Pro', sans-serif;
font-family: 'Oswald', sans-serif;
font-family: 'Anton', sans-serif;
font-family: 'Questrial', sans-serif;
font-family: 'Fredoka One', cursive;
font-family: 'Archivo Black', sans-serif;
font-family: 'Didact Gothic', sans-serif;*/
}


.login{ display: flex; align-items: center;justify-content: center;min-height: 100vh; flex-flow: column; }
.btn{ text-transform: uppercase; }
.buttons-1 {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
    text-transform: uppercase;
    font-size: 18px !important;
    font-weight: 600; transition: 0.5s
}

.buttons-1:hover {  background-color: transparent; border:solid 1px  #007bff; color: #007bff; transition: 0.5s  }


.buttons-2 {
    color: #fff;
    background-color: #66cfc0;
    border-color: #66cfc0;
    text-transform: uppercase;
    font-size: 18px !important;
    font-weight: 600; padding-top: 5px; padding-bottom:  5px
}


.buttons-2:hover {  background-color: transparent; border:solid 1px  #66cfc0; color: #66cfc0; transition: 0.5s  }


.buttons-3 {
    color: #fff;
    background-color: #6a99cf;
    border-color: #6a99cf;
    text-transform: uppercase;
    font-size: 18px !important;
    font-weight: 600; padding-top: 5px; padding-bottom:  5px
}


.buttons-3:hover {  background-color: transparent; border:solid 1px  #6a99cf; color: #6a99cf; transition: 0.5s  }
.small-link{ font-size: 15px }
      </style>
    <title> Login</title>

</head>

<body class="login">

    <!-- Start login form -->
    <div class="col-md-5 col-lg-3    mx-auto section-login">
         <form name="form-signin">
          <div class="card shadow-lg mb-5 bg-white ">
            <div class="card-header text-center">
                <h5 class="mb-0">Sign In</h5></div>

            <div class="card-body">
                <!-- Username -->
                <div class="form-group  mb-3">
                    <label for="" class="mb-1">Username</label>
                    <input type="text" class="form-control" placeholder="Please enter Username" />
                </div>

                <!-- Password -->
                <div class="form-group mb-3">
                    <label for="" class="mb-1">Password</label>
                    <input type="password" class="form-control" placeholder="Please enter Password" />
                </div>

                <div class="form-group mb-3">
                    <a href="home.html" class="btn btn-primary buttons-1 w-100">Sign In</a>
                </div>

                <div class="form-group mb-3 text-center">
                    <a class="small-link" href="#" data-toggle="modal" data-target="#forgotpassword">Forgot Password?
    </a>
                </div>

            </div>
          </div>
        </form>

        <div class="col-md-12  p-0">
            <div class="input-group mb-3">
                <a href="home.html" class="btn btn-primary buttons-3  mx-auto w-100 shadow-lg">Sign Up</a>
            </div>
        </div>

    </div>

    <!-- End login form -->


    <!--Start Forgot password modal -->

    <div class="modal fade forgot-password-modal modal-center" id="forgotpassword" tabindex="-1" role="dialog" aria-labelledby=" " aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered">
            <div class="modal-content">
                <div class="modal-header">
                    <h4 class="modal-title" id="forgotpassword">Forgot Password</h4>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body p-4">
                    <form class="form-forgotpassword">
                        <div class="form-group mb-4">
                            <label class="mb-2">&nbsp;Enter Email <span class="text-danger">*</span></label>
                            <input type="text" id=" " class="form-control our-inputs" placeholder="Please enter email" required="">
                        </div>
                        <div class="form-label-group mb-4">
                            <button class="btn button-primary buttons-1 ">Send Link</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- End  Forgot password  modal -->




   
    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>

</body>
</html>

Timeline html / Form wizard html / Steps / HTML wizard / Horizontal Timeline


/* Important things:
         1). Include bootstrap.css (without bootstrap it will not work)
         2). Below all  copy to external css page
         3). Add active to item div                      */




<!doctype html>
<html lang="en">
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="icon" type="image/x-icon" href="images1/fevicon.png">
    <title>Timeline</title>

    <link rel="stylesheet" href="css/bootstrap.css" />

</head>
<body> 



<style type="text/css"> 
     /* Important things:
         1). Include bootstrap.css (without bootstrap it will not work)
         2). Below all  copy to external css page */


.card-bg{ border: solid 1px #555; }
.h-timeline p{ font-size: 11px }
.h-timeline .item {    width: 20%;    text-align: center;}

.h-timeline > .item{ position: relative; }
.h-timeline > .item > .dot:before{     content: "";    width: 15px;    height: 15px;    background-color: #962b2b;    border-radius: 30px;    border-color: red;    margin-top: 4px;    position: absolute;    border: 0px;
    left: 42%;    top: -22px;    z-index: 9999;    cursor: pointer;}

.h-timeline > .item > .dot:after { content: ""; position: absolute; width:100%;background-color:red;border: solid 2px red;left:-56%; top: -13px;}

.h-timeline > .item.item1 > .dot:after{ display: none; }
.h-timeline > .item.active > .dot:after {    background-color: green;    border: solid 2px green;}
.h-timeline > .item.active > .dot:before {    background-color: green;}


@media(max-width: 767px){
    .h-timeline > .item > .dot:after {left: -37px;}
}
</style>



<!-- horizantal timeline with acctive progress -->
<div class="col-md-8 p-0 mx-auto mt-5   ">
    <div class="card card-bg  ">
        <div class="col-md-12 pt-0 p-2">
            <h5>Section</h5>
            <div class="h-timeline d-flex  pt-4">
                <div class="item item1 active"><div class="dot"></div><p>Step 1</p></div>
                <div class="item item2 active"><div class="dot"></div><p>Step 2</p></div>
                <div class="item item3"><div class="dot"></div><p>Step 3</p></div>
                <div class="item item4"><div class="dot"></div><p>Step 4</p></div>
                <div class="item item5"><div class="dot"></div><p>Step 5</p></div>
            </div>
        </div>
    </div>
</div>


    <!-- jQuery -->
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
   
</body>
</html>

Monday, 6 January 2020

Create VirtualHost / Create Virtual Server setup / Server Setup in Windows


D\xampp\apache\conf\extra\httpd-vhosts.conf
-------------------------------------------

<VirtualHost *:80>
DocumentRoot "D:\xampp\htdocs\mnop"
ServerName dev.mnop.com
ServerAlias dev.mnop.com
<Directory "D:\xampp\htdocs\mnop">
AllowOverride All
Require all Granted
</Directory>
</VirtualHost>



File for : C\Windows\System32\drivers\etc\hosts
-----------------------------------------------
127.0.0.1 dev.mnop.com(whatever your requirement)

Tuesday, 10 December 2019

Angular Installation Instructions, Angular Instructions


Angular

Installation Instructions

·         Node Install = Manual
·         npm install    =  npm install
·         Angular CLI installation = npm install -g @angular/cli
·         Bootstrap install = npm install bootstrap
·         Bootstrap install for version based = npm install bootstrap@3
·         Create component = ng g c compnentname
·         Check node version = node -v
·         Check npm version = npm  -v
·         Check angular Cli version = ng   - - version (double hyphens)
·         Create new project = ng new projectname
·         Change port commandng serve --port 4401 (type portname)
·         Router outlet = <router-outlet></router-outlet>



Serial Number / Number Increment:
<table>
     <tr *ngFor="let data of mydata; let i=index">
         <td>{{ i + 1 }}</td>
            <td>{{data.title}}</td>      
     </tr>
 </table>



















Sample app-routing.module


import { NgModule, Component } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './components/login/login.component';
import { DashboardComponent } from './components/dashboard/dashboard.component';
import { SidebarComponent } from './components/sidebar/sidebar.component';
import { MainComponent } from './components/main/main.component';
import { AppmanagementComponent } from './components/appmanagement/appmanagement.component';
import { PagenotfoundComponent } from './components/pagenotfound/pagenotfound.component'
import { DataComponent } from './components/data/data.component';
import { Data1Component } from './components/data1/data1.component';
import { Data1linksComponent } from './components/data1links/data1links.component';
import { Data2Component } from './components/data2/data2.component';
import { Data4Component } from './components/data4/data4.component';
 import { Data2linksComponent } from './components/data2links/data2links.component';
 import { Data4linksComponent } from './components/data4links/data4links.component';
import { Data3linksComponent } from './components/data3links/data3links.component';
import { Data3Component } from './components/data3/data3.component';
import { ContactformComponent } from './components/contactform/contactform.component';

const routes: Routes = [
  {path:'',redirectTo:'login', pathMatch:'full' },
  {path:'login',component:LoginComponent },
  {path:'dashboard',component:DashboardComponent },
  {path:'appmanagement',component:AppmanagementComponent },
  {path:'data1link/:id',component:Data1linksComponent },
  {path:'data',component:DataComponent }, 
  // {path:'datalink/:id:name',component:DatalinkComponent },
  {path:'data1',component:Data1Component },
  {path:'data2',component:Data2Component },
  {path:'data4',component:Data4Component },
  {path:'data2link/:id',component:Data2linksComponent },
  {path:'data4links/:id',component:Data4linksComponent },
  {path:'data3',component:Data3Component },
  {path:'data3link/:id',component:Data3linksComponent },
  {path:'contactform',component:ContactformComponent }, 
  {path:'**',component:PagenotfoundComponent } 
  
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }



















Get / Post Data from API
Service.ts
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient } from '@angular/common/http';

@Injectable({
  providedIn: 'root'
})
export class CommonService {

  constructor(private http:HttpClient) { }  
  appmanagement():Observable<any>{
    let url="https://jsonplaceholder.typicode.com/posts";
    return this.http.get(url);
  }
}


App.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import{ HttpClientModule } from '@angular/common/http';
 imports: [
    BrowserModule,
    AppRoutingModule, HttpClientModule
  ],


Component.ts
import { Component, OnInit } from '@angular/core';
import { CommonService } from '../../services/common.service';
 @Component({
  selector: 'app-appmanagement',
  templateUrl: './appmanagement.component.html',
  styleUrls: ['./appmanagement.component.css']
})
export class AppmanagementComponent implements OnInit {
  mydata:any;
  constructor(private CommonService:CommonService) { }
 ngOnInit() {
this.CommonService.appmanagement().subscribe(data => { this.mydata = data;})

   }
}


HTML
 <table>
     <tr *ngFor="let data of mydata; let i=index">
         <td>{{ i + 1 }}   </td>
         <td> {{data.title}}</td>
       
     </tr>
 </table>