Author: therichpost

  • WordPress send pdf with wp_mail function

    WordPress send pdf with wp_mail function

    Hello to all, welcome to therichpost.com. In this post, I will tell you, WordPress send pdf with wp_mail function.

    Here is the working code and you can add this code into your main function or any hook:

    $attachments = array(WP_CONTENT_DIR .'/uploads/2019/08/your-pdf-fine-name.pdf'); 
    $to  = 'user@gmail.com';
    $subject = 'WordPress wp_mail';
    $message     = "Please check the attached PDF.";
    array('Content-Type: text/html; charset=UTF-8', 'From: mysite <contact@mail.com>');
    wp_mail( $to, $subject, $message, $headers, $attachments );

     

    If you have any query then please let me know.

    Jasa jatt

    thank you

  • Angular 8 with laravel 6 backend working example

    Angular 8 with laravel 6 backend working example

    Hello to all, welcome to therichpost.com. Today, In this post, I will tell you, Angular 8 with laravel 6 backend working example.

    Both Angular 8 and Laravel 6 are the best on their platforms. Today, In this post, I will take Angular 8 as frontend and Laravel 6 as backend.

    If you are new then you can check my old posts related to Laravel 6 and Angular 8.

    Here is the images showing of Angular 8 frontend in which I am getting data from laravel 6.

    Angular 8 with laravel 6 backend working example
    Angular 8 with laravel 6 backend working example

    Here are the complete code snippet for Angular 8 with laravel 6 backend working example and please use this carefully:

    1. Let start, here are the basics commands to set Angular 8 into your pc:

    $ npm install -g @angular/cli //Setup Angular8 atmosphere
    
    $ ng new angularlatest8 //Install New Angular App
    
    /**You need to update your Nodejs also for this verison**/
    
    $ cd angularlatest8 //Go inside the Angular 8 Project

     

    2. After all above setup, here is code, you need to add into your app.module.ts file:

    import { BrowserModule } from '@angular/platform-browser';
    import { NgModule } from '@angular/core';
    import { HttpClientModule } from '@angular/common/http';
    import { AppComponent } from './app.component';
    
    @NgModule({
      declarations: [
        AppComponent
      ],
      imports: [
        BrowserModule,
        HttpClientModule
      ],
      providers: [],
      bootstrap: [AppComponent]
    })
    export class AppModule { }

     

    3. Here is the code, you need to add app.component.ts file:

    This is laravel project path(http://localhost/blog/public/api/sample-restful-apis)where I have set the api from where I am getting the data.

    import { Component } from '@angular/core';
    import { HttpClient } from '@angular/common/http';
    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent {
      title = 'angular8restapi';
      data = [];
      constructor(private http: HttpClient) {
        this.http.get('http://localhost/blog/public/api/sample-restful-apis').subscribe(data => {
        this.data.push(data);
        console.log(this.data);
        }, error => console.error(error));
      }
    }

     

    4. Here is the code you need to add into app.component.html file:

    <table>
        <tr>
          <th>Name</th>
          <th>Domain</th>
          
        </tr>
        <tr *ngFor="let mydata of data[0]">
          <td>{{mydata.name}}</td>
          <td>{{mydata.domain}}</td>
        </tr>
    </table>

     

    5. Here is the code, you need add into app.component.css file:

    table {
        font-family: arial, sans-serif;
        border-collapse: collapse;
        width: 100%;
      }
      
      td, th {
        border: 1px solid #dddddd;
        text-align: left;
        padding: 8px;
      }
      
      tr:nth-child(even) {
        background-color: #dddddd;
      }

     

     

    6. Here is the final code, you need to into your laravel 6 api.php file, where we will have the data to show in angular 8 application:

    ...
    Route::get('sample-restful-apis', function()
    {
        return response()->json([
            [
                'name' => 'Google',
                'domain' => 'Google.com'
            ],[
                'name' => 'Google',
                'domain' => 'Google.com'
            ],[
                'name' => 'Google',
                'domain' => 'Google.com'
            ],[
                'name' => 'Google',
                'domain' => 'Google.com'
            ],[
                'name' => 'Google',
                'domain' => 'Google.com'
                ]
            ]);
    });
    ...

     

    In the end don’t forget to run ng serve command to enjoy the final output.

    If you have any query then please let me know or comment below.

    Jassa Jatt

    Thank you

  • Angular 8 chartjs working example

    Angular 8 chartjs working example

    Hello to all, welcome to therichpost.com. In this post, I will tell you, Angular 8 chartjs working example.

    Chartjs is very popular and very easy to use. On my blog, I have share many posts related to chartjs.

    Now, I am using chartjs in angular 8 and in this I will static data but In my future posts, I will dynamic data from laravel 6.

    chartjs-in-angular8
    chartjs-in-angular8

    Here is the working code snippet and please use this carefully:

    1. Here are the basics commands, you need to use into your terminal or command prompt to install Angular 8 fresh set up:

    $ npm install -g @angular/cli //Setup Angular8 atmosphere
    
    $ ng new angular8chartjs //Install New Angular App
    
    /**You need to update your Nodejs also for this verison**/
    
    $ cd angular8chartjs //Go inside the Angular 8 Project

    2. After Install Angular 8 fresh setup and go inside the Angular 8 setup, run below command into your terminal to install chartjs module:

    npm install --save chart.js

    3. After all above setup, here is code, you need to add into your app.component.ts file:

    import { Component } from '@angular/core';
    import * as Chart from 'chart.js'
    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent {
      title = 'angular8chartjs';
      canvas: any;
      ctx: any;
      ngAfterViewInit() {
        this.canvas = document.getElementById('myChart');
        this.ctx = this.canvas.getContext('2d');
        let myChart = new Chart(this.ctx, {
          type: 'pie',
          data: {
              labels: ["New", "In Progress", "On Hold"],
              datasets: [{
                  label: '# of Votes',
                  data: [1,2,3],
                  backgroundColor: [
                      'rgba(255, 99, 132, 1)',
                      'rgba(54, 162, 235, 1)',
                      'rgba(255, 206, 86, 1)'
                  ],
                  borderWidth: 1
              }]
          },
          options: {
            responsive: false,
            display:true
          }
        });
      }
    }
    

    4. Now, add below code into your app.component.html file:

    <canvas id="myChart" width="700" height="400"></canvas>

    In this end, don’t forget to run ng serve command into your terminal and you will get this url localhost:4200

    If you have any query related to this post, then please comment below.

    jassa

    Thank you

  • Laravel 6 auth working example

    Laravel 6 auth working example

    Hello to all, welcome to therichpost.com. In this post, I will tell you, Laravel 6 auth working example.

    Laravel 6 has been launched recently and Laravel 6 has many good features and in this post, I will share laravel 6 auth feature.

    Laravel is the best PHP MVC framework.

    Here are the commands and code for Laravel 6 auth and please use this carefully.


    1. Here are the basic commands to set laravel 6 working environment:

    First don’t forget to install nodejs latest version and then below commands into your terminal(GIT BASH) or command command prompt:
    composer global require laravel/installer
    
    composer create-project --prefer-dist laravel/laravel laravel6auth
    
    cd laravel6auth

    2. After run the above commands, run below command provides a quick way to scaffold all of the routes and views you need for authentication using a few simple commands:

    composer require laravel/ui --dev

    3. After above command below command should be used on fresh applications and will install a layout view, registration and login views, as well as routes for all authentication end-points:

    php artisan ui vue --auth

    4. Now these two commands will be use to styling view layouts like login form, registration etc:

    npm install
    
    npm run dev

    5. Now run below command and you will see below two images kind of screens:

    php artisan serve


    6. After above please check below post link to set laravel database with laravel migrate command:

    laravel migrate

    If you have any query related to this post, then please do comment below.

    jassa Jatt

    Thank you.

  • laravel 6 comes with great authentication features.

    laravel 6 comes with great authentication features.

    Hello to all, welcome to therichpost.com. In this post, I will tell you, laravel 6 comes with great authentication features.

    laravel the best PHP MVC and now laravel came with laravel 6 with lots of great features and I will tell you all but first, I will tell little about Laravel 6 Authentication feature.

    Jassa Jatt

    Thank you

  • How to get month difference between two dates?

    How to get month difference between two dates?

    Hello to all, welcome to therichpost.com. In this post, I will tell you, How to get month difference between two dates?

    I like jQuery the most and in my all the project, I do my all the things done with jquery.

    In this post, I will tell and How to get month difference between two dates? with help of jquery.

    Here is the working code snippet and you can add this code into your HTML file easily:

    Old Date(2019 january): <span class="OldDate">2/10/2019</span>
    Today(september month 2019): <span class="Todaydate">9/10/2019</span>
    
    
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script>
     jQuery(document).ready(function($)
     {
       var OldDate = $(".OldDate").text();
       var Newdate = $(".Todaydate").text();
       var oldD = new Date(OldDate);
       var newD = new Date(Newdate);
       //This alert will show you months diffrence
       alert((newD.getMonth()+1)-(oldD.getMonth()+1)); 
     })
    </script>

     

    This is just demo working code and you can modify it with your own requirement.

    Jassa Jatt.

    Thank you

  • Angular 8 restful api working example

    Angular 8 restful api working example

    Hello to all. welcome to therichpost. In this post, I will tell you, Angular 8 restful api working example.

    Here you can check more posts related to Angular 8.

    First of all, thank you to all to make my website much better in google ranking. I will work hard for my blog and I will share good post and hope my post will help you out.

    In this post, I will tell you, How to work with Angular 8 restful api and I am getting data from Laravel or I can say Laravel is my backend.

    Rest API means transfer the data from one to other and In Angular 8, I will use HttpClient to fetch the data from laravel.

    I will tell you the very simple code to do this thing.

    Here is the complete working code and please add this carefully into your Angular 8 application.

    1. Let start, here are the basics commands to set Angular 8 into your pc:

    $ npm install -g @angular/cli //Setup Angular8 atmosphere
    
    $ ng new angularlatest8 //Install New Angular App
    
    /**You need to update your Nodejs also for this verison**/
    
    $ cd angularlatest8 //Go inside the Angular 8 Project

     

    2. After all above setup, here is code, you need to add into your app.module.ts file:

    import { BrowserModule } from '@angular/platform-browser';
    import { NgModule } from '@angular/core';
    import { HttpClientModule } from '@angular/common/http';
    import { AppComponent } from './app.component';
    
    @NgModule({
      declarations: [
        AppComponent
      ],
      imports: [
        BrowserModule,
        HttpClientModule
      ],
      providers: [],
      bootstrap: [AppComponent]
    })
    export class AppModule { }
    

     

    3. Here is the code, you need to add app.component.ts file:

    This is laravel project path(http://localhost/blog/public/api/sample-restful-apis)where I have set the api from where I am getting the data.

    import { Component } from '@angular/core';
    import { HttpClient } from '@angular/common/http';
    @Component({
      selector: 'app-root',
      templateUrl: './app.component.html',
      styleUrls: ['./app.component.css']
    })
    export class AppComponent {
      title = 'angular8restapi';
      data = [];
      constructor(private http: HttpClient) {
        this.http.get('http://localhost/blog/public/api/sample-restful-apis').subscribe(data => {
        this.data.push(data);
        console.log(this.data);
        }, error => console.error(error));
      }
    }

     

    4. Here is the code you need to add into app.component.html file:

    <table>
        <tr>
          <th>Name</th>
          <th>Domain</th>
          
        </tr>
        <tr *ngFor="let mydata of data[0]">
          <td>{{mydata.name}}</td>
          <td>{{mydata.domain}}</td>
        </tr>
    </table>

     

    5. Here is the code, you need add into app.component.css file:

    table {
        font-family: arial, sans-serif;
        border-collapse: collapse;
        width: 100%;
      }
      
      td, th {
        border: 1px solid #dddddd;
        text-align: left;
        padding: 8px;
      }
      
      tr:nth-child(even) {
        background-color: #dddddd;
      }

     

    6. Here is the final code, you need to into your laravel api.php file, where we will have the data to show in angular 8 application:

    ...
    Route::get('sample-restful-apis', function()
    {
        return response()->json([
            [
                'name' => 'Google',
                'domain' => 'Google.com'
            ],[
                'name' => 'Google',
                'domain' => 'Google.com'
            ],[
                'name' => 'Google',
                'domain' => 'Google.com'
            ],[
                'name' => 'Google',
                'domain' => 'Google.com'
            ],[
                'name' => 'Google',
                'domain' => 'Google.com'
                ]
            ]);
    });
    ...

     

     

    In the end don’t forget to run ng serve command to enjoy the final output.

    If you have any query then please let me know or comment below.

    Jassa Jatt

    Thank you

  • Angular 8 sticky navbar working example

    Angular 8 sticky navbar working example

    Hello to all, welcome to therichpost.com. In this post, I will tell you, Angular 8 sticky navbar working example.

    Hello friends, if you are new in Angular world then you can check my old posts related to Angular 7 and Angular 8. Also, you are any question related Angular old and latest versions.

    In this post, I will share you code related to Angular sticky navbar and this is very simple to implement.

    Here are the working code and commands, you need to run and add into your Angular 8 application:

    1. Let start, here are the basics commands to set Angular 8 into your pc:

    $ npm install -g @angular/cli //Setup Angular8 atmosphere
    
    $ ng new angularlatest8 //Install New Angular App
    
    /**You need to update your Nodejs also for this verison**/
    
    $ cd angularlatest8 //Go inside the Angular 8 Project

    2. After Install Angular 8 fresh setup and go inside the Angular 8 setup, run below command into your terminal to install angular sticky nav module:

    npm install ng2-sticky-nav --save

    3. After all above setup, here is code, you need to add into your app.module.ts file:

    // Import your library
    import { StickyNavModule } from 'ng2-sticky-nav';
    
    @NgModule({
      ....
      imports: [
            ...
      StickyNavModule
            ...
      ],
      ....
    })

    4. Now, add below code into your app.component.html file:

    <div class="container">
    <div class="sticky-nav-wrapper">
      <nav class="sticky-nav" ngStickyNav stickyClass="sticky-box-shadow" ngStickyNav>
      <ul>
      <li>
      Home
      </li>
       <li>
      About Us
      </li>
       <li>
      Contact
      </li>
      </ul>
      </nav>
    </div>
    <p>
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    
    
    
    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 it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
    </p>
    
    </div>

    5. Finally, add below code into app.component.css file:

    .container{padding: 10px;
        margin: 10px;
        text-align: justify;}
    .sticky-nav {
      width: 98%;
        float: left;
        padding: 10px;
        background: #eee;
        margin-bottom: 20px;
    }
    
    .sticky-nav ul{padding:0px; margin:0px;}
    
    .sticky-box-shadow {
      box-shadow: 0px 0px 10px 5px rgba(0,0,0,0.5);
      width: 94%;
      background:#000!important;
      color:#fff;
    }
    .sticky-nav  ul li{float: left;
        margin-right: 20px;
        list-style-type: none;
        font-size: 24px;}

    In this end, don’t forget to run ng serve command into your terminal.

    If you have any query related to this post, then please comment below.

    jassa

    Thank you

  • Angular 8 change active menu color during routing

    Angular 8 change active menu color during routing

    Hello to all, welcome to therichpost.com. In this post, I will tell you, Angular 8 change active menu color during routing.

    If you are new in Angular then you can also check my old post related to Angular 8  and Angular 7.

    In this post, Angular 8 Routing will also be covered.

    Here is the complete code and please use this carefully:

    1. Let start, here are the basics commands to set Angular 8 into your pc:

    $ npm install -g @angular/cli //Setup Angular8 atmosphere
    
    $ ng new angularlatest8 //Install New Angular App
    
    /**You need to update your Nodejs also for this verison**/
    
    $ cd angularlatest8 //Go inside the Angular 8 Project

     

    2. After Install Angular 8 fresh setup and go inside the Angular 8 setup, run below command into your terminal for creating new angular components:

    ng g component aboutus
    
    ng g component contactus

     

    3. After done with above commands and angular 8 setup and add below code into app.module.ts file:

    import { BrowserModule } from '@angular/platform-browser';
    import { NgModule } from '@angular/core';
    import { AppComponent } from './app.component';
    import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
    import { Routes, RouterModule } from '@angular/router';
    import { AboutusComponent } from './aboutus/aboutus.component';
    import { ContactusComponent } from './contactus/contactus.component';
    
    const appRoutes: Routes = [
        { path: 'aboutus', component: AboutusComponent },
      { path: 'contactus', component: ContactusComponent }
    ];
    
    @NgModule({
      declarations: [
        AppComponent,
        AboutusComponent,
        ContactusComponent
      ],
      imports: [
        BrowserModule,
      BrowserAnimationsModule, 
        RouterModule.forRoot(
          appRoutes,
          { enableTracing: true } // <-- debugging purposes only
        )	
      ],
      entryComponents: [AppComponent],
      providers: [],
      bootstrap: [AppComponent]
    })
    export class AppModule { }

     

    4. Now add below code into app.component.html file:

    <nav class="navbar navbar-expand-sm bg-light">
      <ul class="nav nav-pills">
          <li class="nav-item"><a class="nav-link" routerLinkActive="home" [routerLinkActiveOptions]="{exact: true}" routerLink="/">Home</a></li>
          <li class="nav-item"><a class="nav-link"  routerLinkActive="aboutus" [routerLinkActiveOptions]="{exact: true}" routerLink="/aboutus">About Us</a></li>
          <li class="nav-item"><a class="nav-link"  routerLinkActive="contactus" [routerLinkActiveOptions]="{exact: true}" routerLink="/contactus">Contact Us</a></li>
      </ul>
    </nav>
    <br>
    
    <div class="container-fluid">
    <h3><router-outlet></router-outlet></h3>
    </div>

     

    5. Finally add below code into app.component.css file:

    .nav-pills{margin: 0;padding: 25px 0 42px;background: #eee;}
    .nav-pills li{float: left;margin: 0 0 0px 38px;list-style-type: none;}
    .container-fluid{background: #eee;padding: 20px 30px;}
    .home{color:red!important}
    .aboutus{color:yellow!important}
    .contactus{color:green!important}

     

    In the end, don’t forget to run ng serve command to see final working output.

    If you have any query then please comment below.

    Jassa Jatt

    Thank you

  • Remove Wp Version – for security

    Remove Wp Version – for security

    Hello to all, welcome to therichpost.com. In this post, I will tell you, how to Remove Wp Version – for security.

    I came with another Wp Trick. This will help you in many ways like first for security purpose.

    Here, I am going to share the code and you just need to add this into your theme’s functions.php file:

    function therichpost_remove_wp_version() { return ''; }
    add_filter('the_generator', 'therichpost_remove_wp_version');

    Hope this wp trick will help you. If you have any query then please let me know.

    Here you can see the working video:

    Jassa,

    Thank you