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>

Saturday, 16 November 2019

Testimonials slider / Swipe slider / Text slider / Slider



<div class="testimonials">
<div class="container">

<div class="col-md-12 px-0 mx-auto">
<div class="row mx-0 ">
<div class="col-md-12">
<h2 class="text-center">Testimonials</h2>
</div>
</div>


<div class="row mx-0">
<div class="col-sm-12">
<div class="carousel-controls testimonial-carousel-controls">
<div class="control d-flex align-items-center justify-content-center prev mt-3"><i
class="fa fa-chevron-left"></i></div>
<div class="control d-flex align-items-center justify-content-center next mt-3"><i
class="fa fa-chevron-right"></i></div>

<div class="testimonial-carousel">
<div class="one-slide mx-auto">
<div
class="testimonial w-100 px-3 text-center d-flex flex-direction-column justify-content-center flex-wrap align-items-center">
<div class="col-md-3"><img src="images/testimonial-sample.png" /></div>
<div class="col-md-9">
<div class="text-left blockquote">Lorem Ipsum is simply dummy text of the
printing and typesetting industry. Lorem Ipsum has been the industry's
standard dummy text ever since the 1500s, when an unknown printer took a
galley of type and scrambled</div>
<div class="blockquote-footer  text-left">
<h4>Name here</h4>
<p>Designation here</p>
</div>
</div>
</div>
</div>
<div class="one-slide mx-auto">
<div
class="testimonial w-100 px-3 text-center d-flex flex-direction-column justify-content-center flex-wrap align-items-center">
<div class="col-md-3"><img src="images/testimonial-sample.png" /></div>
<div class="col-md-9">
<div class="text-left blockquote">Lorem Ipsum is simply dummy text of the
printing and typesetting industry. Lorem Ipsum has been the industry's
standard dummy text ever since the 1500s, when an unknown printer took a
galley of type and scrambled</div>
<div class="blockquote-footer  text-left">
<h4>John Smith</h4>
<p>CEO</p>
</div>
</div>
</div>
</div>
<div class="one-slide mx-auto">
<div
class="testimonial w-100 px-3 text-center d-flex flex-direction-column justify-content-center flex-wrap align-items-center">
<div class="col-md-3"><img src="images/testimonial-sample.png" /></div>
<div class="col-md-9">
<div class="text-left blockquote">Lorem Ipsum is simply dummy text of the
printing and typesetting industry. Lorem Ipsum has been the industry's
standard dummy text ever since the 1500s, when an unknown printer took a
galley of type and scrambled</div>
<div class="blockquote-footer  text-left">
<h4>John Smith</h4>
<p>CEO</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

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

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


<link href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.css" rel="stylesheet" />
<style type="text/css">
.slick-dots img{display:block;width:100%;height:auto}
.slick-dots{display:flex;justify-content:center;margin:0;padding:1rem 0;list-style-type:none}
.slick-dots li{margin:0 .25rem}.slick-dots
button{display:block;width:1rem;height:1rem;padding:0;border:none;border-radius:100%;background-color:#e5e5e5;text-indent:-9999px}
li.slick-active
button{background-color:#2aabe1}
.carousel-controls .control{position:absolute;transform:translateY(-50%);width:45px;height:45px;border-radius:50%;border:2px solid
#fff;z-index:1;top:40%!important;border:4px solid #000}
.prev{left:-2.25rem}
.next{right:-2.25rem}
@media screen and (max-width:768px){.testimonials{max-height:700px}.icon-overlay{height:300px;top:calc(50% -
150px)}.carousel-controls .control{width:25px;height:25px}.prev{left:0}.next{right:0}
.control i{font-size:.7rem}.testimonials .message{font-size:1rem}.testimonials h2{font-size:1.5rem}}
</style>


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

<script src="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.8.1/slick.min.js"></script>
 <script>
 $(document).ready(function() {
  $(".testimonial-carousel").slick({
    dots: true,
  
    infinite: true,
    slidesToShow: 1,
    slidesToScroll: 1,
    autoplay: true,
    arrows: true,
    prevArrow: $(".testimonial-carousel-controls .prev"),
    nextArrow: $(".testimonial-carousel-controls .next")
  });
});
</script>

Thursday, 7 November 2019

Ranger / Price Range Bootstrap 4













<!doctype html>
<html lang="en">
   <head>
      <!-- Required meta tags -->
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <!-- Bootstrap CSS -->
      <link rel="stylesheet" href="css/bootstrap.min.css" />
      <title>Value Ranger</title>
   </head>
   <body>
     
      <div class="col-md-6 mx-auto  p-0 mb-5 "> <h1>HTML Ranger</h1>
         <div class="input-group my-2">
            <label for="customRange">Range 1</label>
            <input type="range" class="custom-range" id="customRange" min="0" value="4000" max="29813"> 
            <div id="result" class="mb-2">Value: <b></b></div>
         </div>
         <div class="input-group mb-2">
            <label for="customRange">Range  2
            </label>
            <input type="range" class="custom-range" id="customRange1"  min="0" value="12000" max="17817"> 
            <div id="result1"  class="mb-2">Value: <b></b></div>
         </div>
      </div>
      <!-- Optional JavaScript -->
      <!-- jQuery first, then Popper.js, then Bootstrap JS -->
      <script  src="js/jquery-3.3.1.min.js" ></script>
      <script src="js/bootstrap.min.js"></script> 
      <script>
         $(document).ready(function(){
             // Read value on page load
             $("#result b").html($("#customRange").val());
         
             // Read value on change
             $("#customRange").change(function(){
                 $("#result b").html($(this).val());
             });
         
         
                $("#result1 b").html($("#customRange1").val());
         
             // Read value on change
             $("#customRange1").change(function(){
                 $("#result1 b").html($(this).val());
             });
         });        
      </script>
   </body>
</html>

Saturday, 5 October 2019

Circle progress bar with Number / Percentage



<!doctype html>
<html lang="en">
   <head>
      <!-- Bootstrap 4 CSS -->
      <link rel="stylesheet" href="css/bootstrap.min.css" />
   </head>
   <body>
      <section class="main-content">
         <div class="col-md-4 mx-auto mt-5 pt-5 col-12" >
            <div>
               <div class="progress" data-percentage="20">
                  <span class="progress-left">
                  <span class="progress-bar"></span>
                  </span>
                  <span class="progress-right">
                  <span class="progress-bar"></span>
                  </span>
                  <div class="progress-value">
                     <div class="text-center">
                        <h1>  <i class="fa fa-users"></i><span class="counter">20</span></h1>
                     </div>
                  </div>
               </div>
            </div>
         </div>
      </section>
      <!-- jQuery first, then Popper.js, then Bootstrap JS -->
      <script src="js/jquery.min.js" ></script>   
      <script src="js/bootstrap.min.js"  ></script>
      <script src="js/popper.min.js" ></script>
      <script  src="js/jquery.counterup.min.js"></script>
      <script  src="js/waypoints.min.js"></script>
      <script type="text/javascript">
         $('.counter').counterUp({
         delay: 10,
         time: 2000
         });
         $('.counter').addClass('animated fadeInDownBig');
         $('h3').addClass('animated fadeIn');
      </script>
      <style type="text/css">
         .progress {
         width: 250px;
         height: 250px;
         background: none;
         position: relative;
         }
         .progress::after {
         content: "";
         width: 100%;
         height: 100%;
         border-radius: 50%;
         border: 20px solid #eee;
         position: absolute;
         top: 0;
         left: 0;
         }
         .progress>span {
         width: 50%;
         height: 100%;
         overflow: hidden;
         position: absolute;
         top: 0;
         z-index: 1;
         }
         .progress .progress-left {
         left: 0;
         }
         .progress .progress-bar {
         width: 100%;
         height: 100%;
         background: none;
         border-width: 20px;
         border-style: solid;
         position: absolute;
         top: 0;
         }
         .progress .progress-left .progress-bar {
         left: 100%;
         border-top-right-radius: 124px;
         border-bottom-right-radius:124px;
         border-left: 0;
         -webkit-transform-origin: center left;
         transform-origin: center left;
         }
         .progress .progress-right {
         right: 0;
         }
         .progress .progress-right .progress-bar {
         left: -100%;
         border-top-left-radius: 124px;
         border-bottom-left-radius: 124px;
         border-right: 0;
         -webkit-transform-origin: center right;
         transform-origin: center right;
         }
         .progress .progress-value {
         position: absolute;
         top: 0;
         left: 0;
         }
         /*
         *
         * ==========================================
         * FOR DEMO PURPOSE
         * ==========================================
         *
         */
         .border-primary{border-color: #ed7d33 !important}
         .rounded-lg {
         border-radius: 1rem;
         }
         .text-gray {
         color: #aaa;
         }
         div.h4 {
         line-height: 1rem;
         }
         .col-md-4 {
         text-align: center;
         padding-bottom: 50px;
         border-right: 1px dashed black;
         }
         .col-md-4:last-child {
         border-right: 0px solid black;
         }
         .counter {
         animation-duration: 1s;
         animation-delay: 0s;
         }
         i {
         font-size: 20px !important;
         }
         @media (max-width: 991px) {
         .col-md-4 {
         border-right: 0px dashed black;
         border-bottom: 1px dashed black;
         width: 50%;
         margin: auto auto;
         }
         .col-md-4:last-child {
         border-bottom: 0px dashed black;
         }
         }
         .progress {
         width: 300px;
         height: 300px;
         line-height: 300px;
         background: none;
         margin: 0 auto;
         box-shadow: none;
         position: relative;
         }
         .progress:after {
         content: "";
         width: 100%;
         height: 100%;
         border-radius: 50%;
         border: 7px solid #eee;
         position: absolute;
         top: 0;
         left: 0;
         }
         .progress > span {
         width: 50%;
         height: 100%;
         overflow: hidden;
         position: absolute;
         top: 0;
         z-index: 1;
         }
         .progress .progress-left {
         left: 0;
         }
         .progress .progress-bar {
         width: 100%;
         height: 100%;
         background: none;
         border-width: 20px;
         border-style: solid;
         position: absolute;
         top: 0;
         border-color: #4caf50;
         }
         .progress .progress-left .progress-bar {
         left: 100%;
         border-top-right-radius: 150px;
         border-bottom-right-radius: 150px;
         border-left: 0;
         -webkit-transform-origin: center left;
         transform-origin: center left;
         }
         .progress .progress-right {
         right: 0;
         }
         .progress .progress-right .progress-bar {
         left: -100%;
         border-top-left-radius: 150px;
         border-bottom-left-radius: 150px;
         border-right: 0;
         -webkit-transform-origin: center right;
         transform-origin: center right;
         }
         .progress .progress-value {
         display: flex;
         border-radius: 50%;
         font-size: 36px;
         text-align: center;
         line-height: 20px;
         align-items: center;
         justify-content: center;
         height: 100%;
         font-weight: 300;
         }
         .progress .progress-value div {
         margin-top: 10px;
         }
         .progress .progress-value span {
         font-size:75px;
         line-height: 273px;
         font-weight: 700;
         text-transform: uppercase;
         }
         /* This for loop creates the necessary css animation names Due to the split circle of progress-left and progress right, we must use the animations on each side. */
         .progress[data-percentage="10"] .progress-right .progress-bar {
         animation: loading-1 1.5s linear forwards;
         }
         .progress[data-percentage="10"] .progress-left .progress-bar {
         animation: 0;
         }
         .progress[data-percentage="20"] .progress-right .progress-bar {
         animation: loading-2 1.5s linear forwards;
         }
         .progress[data-percentage="20"] .progress-left .progress-bar {
         animation: 0;
         }
         .progress[data-percentage="30"] .progress-right .progress-bar {
         animation: loading-3 1.5s linear forwards;
         }
         .progress[data-percentage="30"] .progress-left .progress-bar {
         animation: 0;
         }
         .progress[data-percentage="40"] .progress-right .progress-bar {
         animation: loading-4 1.5s linear forwards;
         }
         .progress[data-percentage="40"] .progress-left .progress-bar {
         animation: 0;
         }
         .progress[data-percentage="50"] .progress-right .progress-bar {
         animation: loading-5 1.5s linear forwards;
         }
         .progress[data-percentage="50"] .progress-left .progress-bar {
         animation: 0;
         }
         .progress[data-percentage="60"] .progress-right .progress-bar {
         animation: loading-5 1.5s linear forwards;
         }
         .progress[data-percentage="60"] .progress-left .progress-bar {
         animation: loading-1 1.5s linear forwards 1.5s;
         }
         .progress[data-percentage="70"] .progress-right .progress-bar {
         animation: loading-5 1.5s linear forwards;
         }
         .progress[data-percentage="70"] .progress-left .progress-bar {
         animation: loading-2 1.5s linear forwards 1.5s;
         }
         .progress[data-percentage="80"] .progress-right .progress-bar {
         animation: loading-5 1.5s linear forwards;
         }
         .progress[data-percentage="80"] .progress-left .progress-bar {
         animation: loading-3 1.5s linear forwards 1.5s;
         }
         .progress[data-percentage="90"] .progress-right .progress-bar {
         animation: loading-5 1.5s linear forwards;
         }
         .progress[data-percentage="90"] .progress-left .progress-bar {
         animation: loading-4 1.5s linear forwards 1.5s;
         }
         .progress[data-percentage="100"] .progress-right .progress-bar {
         animation: loading-5 1.5s linear forwards;
         }
         .progress[data-percentage="100"] .progress-left .progress-bar {
         animation: loading-5 1.5s linear forwards 1.5s;
         }
         @keyframes loading-1 {
         0% {
         -webkit-transform: rotate(0deg);
         transform: rotate(0deg);
         }
         100% {
         -webkit-transform: rotate(36);
         transform: rotate(36deg);
         }
         }
         @keyframes loading-2 {
         0% {
         -webkit-transform: rotate(0deg);
         transform: rotate(0deg);
         }
         100% {
         -webkit-transform: rotate(72);
         transform: rotate(72deg);
         }
         }
         @keyframes loading-3 {
         0% {
         -webkit-transform: rotate(0deg);
         transform: rotate(0deg);
         }
         100% {
         -webkit-transform: rotate(108);
         transform: rotate(108deg);
         }
         }
         @keyframes loading-4 {
         0% {
         -webkit-transform: rotate(0deg);
         transform: rotate(0deg);
         }
         100% {
         -webkit-transform: rotate(144);
         transform: rotate(144deg);
         }
         }
         @keyframes loading-5 {
         0% {
         -webkit-transform: rotate(0deg);
         transform: rotate(0deg);
         }
         100% {
         -webkit-transform: rotate(180);
         transform: rotate(180deg);
         }
         }
         .progress {
         margin-bottom: 1em;
         }
         body{
         font-family: 'Montserrat', sans-serif;
         /* font-family: 'Open Sans', sans-serif;*/
         }
         .progress .progress-value{display: block; width: 100%}
         .progress-value h1{ font-size: 85px !important }
      </style>
   </body>
</html>

Wednesday, 18 September 2019

Basic Ajax call with Jquery


 <!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  

    <script type="text/javascript">
        $( document ).ready(function(){
    $.ajax({
        url: 'https://jsonplaceholder.typicode.com/posts',
        dataType: 'jsonp',
        success: function (data) {
            //$('div').html(JSON.stringify(data));
            var mydatalist="";
            for(var i = 0; i < data.length; i++)
            {
            //console.log(data[i].userId);
            mydatalist += "<ul>";
            mydatalist += "<li>"+ data[i].id + "</li>";
             mydatalist += "<li>"+ data[i].title + "</li>";
              mydatalist += "</ul>";
            }
            document.getElementById("myid").innerHTML=mydatalist;
        }
    });
})

    </script>
</head>
<body>
 display text purpose
<div id="myid"></div>

</body>
</html>