Thursday, June 14, 2018

How to integrate Paytm Payment Gateway with Codeigniter | PHP

How to integrate Paytm Payment Gateway :


As we know Paytm is highly popular wallet system in india and Now a days it's growing very fast. So here in this tutorial you will learn how to integrate Paytm payment gateway using PHP on your website.

Step 1: Just go on Paytm site and select SDK to download. In our case we will select PHP.



Step 2: After clicking on PHP you will be redirect on Github site. Now from git URL download "Paytm Payment Gateway PHP Kit".




Step 3: Copy PaytmKit folder in document root of your server (like /var/www/html)

Step 4: Open config_paytm.php file from the PaytmKit/lib folder and update the below constant values
a) PAYTM_MERCHANT_KEY – Can be downloaded from the Paytm portal. One time downloadable
b) PAYTM_MERCHANT_MID - MID (Merchant ID) can be collected from Paytm team
c) PAYTM_MERCHANT_WEBSITE - Website name can be collected from Paytm team


define('PAYTM_ENVIRONMENT', 'TEST'); // PROD
define('PAYTM_MERCHANT_KEY', 'xxxxxxxxxxxxxxxxxxxxxxxx'); //Change this constant's value with Merchant key downloaded from portal
define('PAYTM_MERCHANT_MID', 'xxxxxxxxxxxxxxxxxxxxxxx'); //Change this constant's value with MID (Merchant ID) received from Paytm
define('PAYTM_MERCHANT_WEBSITE', 'xxxxxxx'); //Change this constant's value with Website name received from Paytm


PaytmKit folder is having following files:


1. TxnTest.php – Testing transaction through Paytm gateway.
2. pgRedirect.php – This file has the logic of checksum generation and passing all required parameters to Paytm PG.
3. pgResponse.php – This file has the logic for processing PG response after the transaction processing.
4. TxnStatus.php – Testing Status Query API


Step 5: Now final step to create a sample html form with required filed, You can also find demo html form in PaytmKit/TxnTest.php.



<?php
    header("Pragma: no-cache");
    header("Cache-Control: no-cache");
    header("Expires: 0");


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Merchant Check Out Page</title>
<meta name="GENERATOR" content="Evrsoft First Page">
</head>
<body>
    <h1>Merchant Check Out Page</h1>
    <pre>
    </pre>
    <form method="post" action="pgRedirect.php">
        <table border="1">
            <tbody>
                <tr>
                    <th>S.No</th>
                    <th>Label</th>
                    <th>Value</th>
                </tr>
                <tr>
                    <td>1</td>
                    <td><label>ORDER_ID::*</label></td>
                    <td><input id="ORDER_ID" tabindex="1" maxlength="20" size="20"
                        name="ORDER_ID" autocomplete="off"
                        value="<?php echo "ORDS" . rand(10000,99999999)?>">
                    </td>
                </tr>
                <tr>
                    <td>2</td>
                    <td><label>CUSTID ::*</label></td>
                    <td><input id="CUST_ID" tabindex="2" maxlength="12" size="12" name="CUST_ID" autocomplete="off" value="CUST001"></td>
                </tr>
                <tr>
                    <td>3</td>
                    <td><label>INDUSTRY_TYPE_ID ::*</label></td>
                    <td><input id="INDUSTRY_TYPE_ID" tabindex="4" maxlength="12" size="12" name="INDUSTRY_TYPE_ID" autocomplete="off" value="Retail"></td>
                </tr>
                <tr>
                    <td>4</td>
                    <td><label>Channel ::*</label></td>
                    <td><input id="CHANNEL_ID" tabindex="4" maxlength="12"
                        size="12" name="CHANNEL_ID" autocomplete="off" value="WEB">
                    </td>
                </tr>
                <tr>
                    <td>5</td>
                    <td><label>txnAmount*</label></td>
                    <td><input title="TXN_AMOUNT" tabindex="10"
                        type="text" name="TXN_AMOUNT"
                        value="1">
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td></td>
                    <td><input value="CheckOut" type="submit"   onclick=""></td>
                </tr>
            </tbody>
        </table>
        * - Mandatory Fields
    </form>
</body>
</html>



Step 5: Now above form will post on "pgRedirect.php" file in Paytm kit folder. You may also need to add “CALLBACK_URL” in pgRedirect.php. By default it is commented in thsi file. This is that url on paytm will redirect your user. 


$paramList["CALLBACK_URL"] = "http://yourdomain.com/PaytmKit/pgResponse.php";

Here "http://yourdomain.com" will be your website address.


Step 6: Now in "pgResponse.php" file youe can check all status of your transactions.


<?php
header("Pragma: no-cache");
header("Cache-Control: no-cache");
header("Expires: 0");

// following files need to be included
require_once("./lib/config_paytm.php");
require_once("./lib/encdec_paytm.php");

$paytmChecksum = "";
$paramList = array();
$isValidChecksum = "FALSE";

$paramList = $_POST;
$paytmChecksum = isset($_POST["CHECKSUMHASH"]) ? $_POST["CHECKSUMHASH"] : ""; //Sent by Paytm pg

//Verify all parameters received from Paytm pg to your application. Like MID received from paytm pg is same as your application�s MID, TXN_AMOUNT and ORDER_ID are same as what was sent by you to Paytm PG for initiating transaction etc.
$isValidChecksum = verifychecksum_e($paramList, PAYTM_MERCHANT_KEY, $paytmChecksum); //will return TRUE or FALSE string.


if($isValidChecksum == "TRUE") {
    echo "<b>Checksum matched and following are the transaction details:</b>" . "<br/>";
    if ($_POST["STATUS"] == "TXN_SUCCESS") {
        echo "<b>Transaction status is success</b>" . "<br/>";
        //Process your transaction here as success transaction.
        //Verify amount & order id received from Payment gateway with your application's order id and amount.
    }
    else {
        echo "<b>Transaction status is failure</b>" . "<br/>";
    }

    if (isset($_POST) && count($_POST)>0 )
    {
        foreach($_POST as $paramName => $paramValue) {
                echo "<br/>" . $paramName . " = " . $paramValue;
        }
    }
    

}
else {
    echo "<b>Checksum mismatched.</b>";
    //Process transaction as suspicious.
}

?>



Saturday, June 9, 2018

Birthday wishes for best friend

Birthday wishes for friends :


1) If our friendship was a legal contract, it would be just five words – I’ll Be There For You. Happy birthday.

2) Happy birthday to my true friend who was always there for me through all ups and downs. Today is your Big Day, so let the celebration begin!

3) If Facebook was a real thing, mine would have just one friend – YOU. Happy birthday.

4) I wish you to have an extremely happy birthday! As a friend, you‘re not precious – you are priceless to me!

5) Happy birthday to the friend who knows me like no one else does, and is that person in my life who no one else can be.

6) Happy bday, bestie! You are the person who hears the words of my heart and understands me like nobody does.

7) Isn’t life ironic? I am celebrating the countdown towards death, of the same person without whom I would be unable to live life. Happy birthday.

8) It‘s a true blessing to have a great friend like you and I wish you all the most wonderful things that can be in this world!

9) (From one girl to another) My best friend – the person with whom I would have definitely made out if she was a guy. Happy birthday bestie.

10) One day I made a wish to have a true friend for all the good and the bad times. My wish came true when I met you. Heartfelt wishes to my amazing friend!

11) Our friendship is like the Sun. Even when you can’t see me, I’m always shining for you. Happy birthday.

12) The most heartfelt birthday wishes to my closest friend! May your Big Day bring you nothing but fun, joy and happiness!

13) The last time I blew the candles on my birthday cake, I wished for a friend who’d look out for me and stay with me through thick and thin. My wishes came true, when I found a friend in you. Happy birthday.

14) It doesn‘t matter where life takes us, our friendship and all the special moments that we share will stay forever in my heart. Have a wonderful and unforgettable birthday!

15) Every second, every minute, every hour, every day – these are the only times I think about you. Happy birthday my friend.

16) Happy bday, buddy! Let us celebrate your special day like there is no tommorow!

17) Best friends like you are parents, teachers and lovers all combined into one magical personality. Happy birthday.

18) I am very happy and thankful, because I have such a good friend like you. We share funny moments, we share tears. Wishing you the most wonderful birthday!

19) Finding your value in my life would be like finding water in the ocean – it’s always there. Without you, I would be empty. Happy birthday my friend.

20) Happy Birthday to a great Friend! A friend is one of the nicest things you can have, and one of the best things you can be.
Wishing you a Birthday filled with light and love.

21) I promise to light up your life even after you blow the candles away. Happy birthday.

22) A real friend understands your past, believes in your future and accepts you just the way you are, even… if you are getting older! Enjoy your Big Day!

23) Just like how wine is incomplete without having something on the side to munch, without you my life simply does not pack a punch. Happy birthday to my best friend.

24) Happy Birthday to a true friend! You are such a special blessing to me and I want to wish you a birthday filled with love, laughter and the things you enjoy most.

25) Cheesecakes, tiramisu and gooey tarts – may your life be as sweet as these goodies is the wish I make with all my heart. Happy birthday.

26) Life is much more colourful and exciting when you are around.
Happy Birthday to you – let’s make it grand!

27) Thanks for hearing the words I never said, and understanding my mind which no one else has ever read. Happy birthday to my bestie.

28) Being friends as long as we have, people have started to say we look like alike. I can think of no greater compliment than to be called your sister, that’s for sure. Happy birthday to my closest friend!
29) When you are not around me I feel unlucky. With you by my side, I feel happy and free. Happy birthday mate.

30) Twice a year, we get to celebrate the gift of one another on our birthdays. Let’s make this one the most memorable (until mine comes around again, that is!). Happy birthday!

31) If I was asked to write a birthday wish for you, I’d just draw a heart – because that’s what our friendship means to me. Happy birthday.

32) Here’s wishing you a birthday filled with blessings: the gold at the end of the rainbow, many four-leafed clovers, and the love of a good family. Happy birthday!

33) Every minute I spend hanging out with you is more precious than gold, because it is a priceless memory that I am going to cherish when I am old. Happy birthday buddy.

34) Another year older and you may think the fun of life is almost through. Trust me, dear friend, it is just beginning. Here’s to our fun and fabulous friendship! Happy birthday!


35) I may not be an expert at being your best friend but I promise to try again and again till my dying breath. Happy birthday.

36) Happy birthday to the dearest friend who has been always by my side! Your friendship keeps me strong and moving up in life!

37) I do hope that your birthday cake is the sweetest one ever, but it can never be as sweet as our friendship. Happy birthday.

38) Do you ever just sit back and think about how awesome our friendship is? I do and I love it! Happy birthday, dear friend!

39) Just being around you helps me get more out of each breath. Happy birthday my friend, I will love you to death.

40) Love is fleeting, but friendships are forever. Happy birthday to the best friend anyone could have!

41) Your presence in my life is like the RAIN which parches thirst, creates a beautiful rainbow and always leaves behind a silver lining. Happy birthday to my best friend.

42) Best friendships are like soccer matches. Many more goals are achieved when we work together. Happy birthday to my favorite teammate in life!

43) Happy birthday to the friend who stays in my heart permanently and rightfully refuses to pay rent.

44) On this day, it seems words are not enough to let you know what you mean to me. You are my best friend, confidant, and always push me to achieve my dreams. You mean the world to me and I adore you, best friend! Happy birthday!

45) The difference between you and my other friends is that they know me as a person, and you understand me as an individual. Happy birthday.

46) Enjoy this special occasion. For me, it’s truly exciting to celebrate an extraordinary friend like you.

47) I want to thank you for not just being there for me when I needed you, but being there for me all the time. Happy birthday.

48) I wanted to make you a big surprise, but then I realized there is nothing so nice. Have the best Birthday you deserve all the best.

49) I wish every day was forty eight hours instead of twenty four. Then I’d spend more time with friends like you who I simply adore. Happy birthday.

50) As you celebrate your day, I celebrate the beautiful friendship we share! Happy Birthday, dearest friend!

51) All your other friends will promise to attend your parties but leave shortly after. I, promise to stay back even after the party’s over. Happy birthday.

52) Friendship is not something that is written on paper, because paper can be torn. It is neither something that can be written on a rock, for even a rock can break. But it is written on the heart of a person, and it stays there forever. Birthday wishes and blessings are coming your way, my friend!

53) Everyone can boast about being friends with people when they are likeable. But only best friends can boast about being friends with people even when are irritable. Happy birthday to one such bestie.

54) Happy Birthday to a great Friend! A friend is one of the nicest things you can have, and one of the best things you can be. Wishing you a Birthday filled with light and love.

55) I don’t have a sister but if I ever did, she would have very big shoes to fill – YOURS! Thanks for being my best friend and my sister from another mother.

56) Our friendship is made of gold and it will never rust, will stay precious until the world turns to dust. Happy Birthday and may your every wish come true!

57) Whoever said that a dog is a man’s best friend obviously never met you. Happy birthday.

58) A friend is a person who fills our lives with beauty and grace and makes the world we live in a better and happier place. Thanks for making my world a safer place to live in. Happy Birthday!

59) People who care for me as a friend are just friends. You are special, because you care for me as if you were caring for yourself. Happy birthday.

60) I wish that God sends you His choicest blessings and showers your life with happiness on your birthday. I wish that all that you have ever dreamt of comes true on your birthday. Happy Birthday, buddy. Don’t forget, we gotta party!

61) No matter where life takes us, no matter how far we are from each other – the memories of our friendship will remain in my heart forever. Happy birthday.

62) Some people say: My how time flies when you are having fun. I prefer” My how flies have fun when you are having time. Hope your birthday is fun.

63) I wish that your birthday brings a new year as sweet, peppy and fiery as you. Happy birthday.

64) I think I am lucky, That I have you in life, I never knew what friendship is, Before you came in life, Happy birthday sweet friend!

65) May your destiny take you to every single place that you have always dreamt of. Have an awesome birthday.

66) Yet another year to celebrate our beautiful friendship and cherish all those lovely memories gone by down the years. I just want you to know that you’re really special to me. Happy Birthday to the best friend I’ve ever had.

67) Happy birthday to the person who always reminded me of my worth even when I felt worthless.

68) Happy birthday to my friend who knows me like no one else does and is that person in my life who no one else can be.

69) Having you as a friend is like the warm feeling I get when I hold a hot coffee cup on a cold winter day and curl up with my favorite book on my sofa. Happy birthday to my best friend.

70) I wish that your birthday brings a new year as sweet, peppy and fiery as you my dear. Happy birthday.

71) You may not be the only friend I have but you are definitely the only friend I need. Happy birthday.

72) On your birthday, I want you to know that you mean so much to me. I cherish every single moment spent with you. I’m sending you my best wishes and I wish you have an awesome birthday.

73) Your birthday has not just added a year to your life, but also to our strong friendship which has stood the test of time and strife. Happy birthday my friend.

74) Some people are blessed with a soul-deep friendship. Thank you for being my soul friend! I wish you a beautiful special day!

75) The worst part about being best friends with you is that everything becomes boring as hell, when you are not around. Happy birthday.

76) Cake, candles, greeting cards, gifts, and all the trappings of the birthday tradition, don’t come close to what I wish for you on your special day.

77) Our friendship is like a circle because it has no rough edges and no ends. Happy birthday.

78) Happy birthday to my best friend: the one who laughs at my jokes and cries with me during my heartaches. I love you, and will always be here for you.

79) We are less like best friends and more like twins – even your birthday feels like mine. Happy birthday.

80) Hey! It’s your Birthday! So what better time to celebrate all the many reasons I consider you to be my Best Friend? Hope you have a terrific day!

How to earn money through google adsense

What is Google Adsense?

There are many ways to monetize your website traffic, and most of them are related to advertising third-party products or services to your website visitors. There are many advertising programs that can help you earn money nowadays, but the most popular is Google Adsense.

This advertising program was launched in the middle of 2003 by Google and is currently one of the most popular advertising programs on the Internet. It provides a good opportunity for webmasters and site owners to monetize their traffic. If you’ve asked yourself what is Adsense and how to make money with Adsense, the following article will give you some hints.

One of the advantages of Adsense is its huge number of publishers and advertisers. Google acts as an intermediary between them, so another good feature of Adsense is its high level of security and safety for both advertisers and publishers.

How does adsense work? The whole process is very simple and intuitive. You create an Adsense account, insert a small amount of code into your website pages –and that’s all. Google will display targeted ads on your page that’s relevant to the content of your website, your website visitors will start clicking those ads and you will be paid for it.

AdSense is one of the most convenient waysto make additional money from your website.

All you do is copy some code into your site to display the ads, and you earn every time someone clicks. You may also earn from impressions in some cases.

All this is derived from a program they call AdWords (pay per click marketing).

You often see these ads displayed above the free/organic results and along the right side of the page on Google.com.

These are called Sponsored Results, and the advertisers are paying a certain amount of money per click for these ads.

AdSense is your revenue share from AdWords ads. When someone clicks, you earn roughly 68% of the click and Google gets the rest.

AdSense is an auction-based system that allows advertisers to compete for those spots. Whomever has the highest bid and most “quality” ad, gets the top spot and so forth.

It’s a great program that can help drive additional income to your website, and it’s really best for websites that are mainly content driven.

The more content you have, the more Google can get a sense for what your site is about and better match the ads to your website.

Please make sure you read this entire article. AdSense is not a get-rich-quick scheme and it takes a lot of work to make money. Don’t think that just because you join, you are guaranteed to make big money.




How Much Can You Earn With AdSense?

The commission you receive per click depends on how much advertisers are paying Google for the particular ad. You will earn a share of that amount.  I’ve heard of earnings anywhere from 2 cents to $15 per click.

Getting over $1 is probably very rare, although it does happen from time to time. However, you will find that most of your earnings will be on the lower end of the spectrum.

It’s important to note that I cannot estimate how much you will earn based on your traffic. People always want to know what the average amount is per click.

No one knows the answer to this except Google, so don’t let anyone try to tell you any different. It would be impossible for myself or any AdSense publisher to give this information because the ads all cost different prices and we have no idea what advertisers are paying.

However, there are some niches that obviously pay more. So it is logical to believe that keyword phrases like sex, make money, etc. may earn you more per click since these are highly competitive keywords that are searched for quite a bit on

The more competitive the search term, the more the advertisers pay and the more you earn as a publisher.

Even though Google will not reveal how much you are earning for each ad that is clicked from your site, you can still login to your account at any time and see the total amount of revenue you’ve generated that day, week, month, year, etc.

For example, if you see that you’ve made $12.60 today from 9 clicks then you can calculate that your average click-thru commission was $1.40 per click.  That’s as detailed as their stats will get.  Also remember, that’s only an average.  You won’t know how much each specific ad brought in.

The amount you’ll earn also depends largely on the amount of targeted traffic you receive to your own site, how well the ads match your audience’s interests, the placement of the ads on your pages, and of course the amount you receive per click.

Ideally, you should create a site on a topic you know a lot about.  That way you’ll have a much easier time creating a generous amount of content on that subject.

How to run ionic project in simulator

Run ionic project in simulator :


To find out available emulations I run this :

$ ios-sim showdevicetypes

Note : If you get error like this :-

ios-sim: command not found

Please run :

$ npm install -g ios-sim

Now try  :

$ ios-sim showdevicetypes

This command will return a list something like this :

iPhone-5, 10.3

iPhone-5s, 10.3

iPhone-6, 10.3

iPhone-6-Plus, 10.3

iPhone-6s, 10.3

iPhone-6s-Plus, 10.3

iPhone-7, 10.3

iPhone-7-Plus, 10.3

iPhone-SE, 10.3

iPad-Air, 10.3

iPad-Air-2, 10.3

iPad-Pro–9-7-inch-, 10.3

iPad-Pro, 10.3

Apple-TV-1080p, tvOS 10.2

Apple-Watch-38mm, watchOS 3.2

Apple-Watch-42mm, watchOS 3.2

Apple-Watch-Series-2-38mm, watchOS 3.2

Apple-Watch-Series-2-42mm, watchOS 3.2

Now run below command :-

$ ionic emulate ios –target=”iPhone-7-Plus, 10.3″

If you getting this error :

Error: ENOENT: no such file or directory, stat ‘/var/root/Library/Logs/CoreSimulator/EBA53E00-C037-4A52-87D3-27CFCF4CA8E5/system.log’

Follow below steps :

This happens due to the permissions on mac:

Here are the steps you can use to correct this issue:

Empty the ‘platforms’ folder in your IONIC project.

Re-run ionic platform add ios, ionic build ios, and ionic emulate ios without sudo.

$ ionic platform remove ios  ( to remove platform map be you need to add sudo before this command. like :- $ sudo ionic platform remove ios )

$ ionic platform add ios

$ ionic emulate ios –target=”iPhone-7-Plus, 10.3″


Know when view load in ionic 2 | ionic 3 | ionic 4

Please add below code to detect view load in ionic :


export class SomePage {
  constructor() {
        // …
     }

     ionViewDidLoad() {
          // Put here the code you want to execute when view load
     }
}

ionViewDidLoad : Runs when the page has loaded. This event only happens once per page being created. If a page leaves but is cached, then this event will not fire again on a subsequent viewing. The ionViewDidLoad event is good place to put your setup code for the page.


Show / hide keyboard in ionic 2 | ionic 3 in ionic 2 | ionic 3 | ionic 4

This is very easy by using keyboard plugin. Please use below code in your TS file.


import { Keyboard } from ‘@ionic-native/keyboard’;

@Component({

  selector: ‘page-name’,

  templateUrl: ‘page.html’,

  providers: [Keyboard]

})

constructor(private keyboard: Keyboard) {  

  /* Show keyboard */

  this.keyboard.show();


  /* Hide keyboard */

   this.keyboard.close();

 }


Note : This is only supported by Android. For iOS we can not open keyboard by this function. (Open keyboard method is not works in iOS)



Short forms we use every day without really knowing what they stand for

1. PAN – permanent account number.

2. PDF – portable document format.

3. SIM – Subscriber Identity Module.

4. ATM – Automated Teller machine.

5. IFSC – Indian Financial System Code.

6. FSSAI(Fssai) – Food Safety & Standards Authority of India.

7. Wi-Fi – Wireless fidelity.

8. GOOGLE – Global Organization Of Oriented Group Language Of Earth.

9. YAHOO – Yet Another Hierarchical Officious Oracle.

10. WINDOW – Wide Interactive Network Development for Office work Solution.

11. COMPUTER – Common Oriented Machine. Particularly United and used under Technical and Educational Research.

12. VIRUS – Vital Information Resources Under Siege.

13. UMTS – Universal Mobile Telecommunicati ons System.

14. AMOLED – Active-matrix organic light-emitting diode.

15. OLED – Organic light-emitting diode.

16. IMEI – International Mobile Equipment Identity.

17. ESN – Electronic Serial Number.

18. UPS – Uninterruptible power supply.

19. HDMI – High-Definition Multimedia Interface.

20. VPN – Virtual private network.

21. APN – Access Point Name.

22. LED – Light emitting diode.

23. DLNA – Digital Living Network Alliance.

24. RAM – Random access memory.

25. ROM – Read only memory.

26. VGA – Video Graphics Array.

27. QVGA – Quarter Video Graphics Array.

28. WVGA – Wide video graphics array.

29. WXGA – Widescreen Extended Graphics Array.

30. USB – Universal serial Bus.

31. WLAN – Wireless Local Area Network.

32. PPI – Pixels Per Inch.

33. LCD – Liquid Crystal Display.

34. HSDPA – High speed down-link packet access.

35. HSUPA – High-Speed Uplink Packet Access.

36. HSPA – High Speed Packet Access.

37. GPRS – General Packet Radio Service.

38. EDGE – Enhanced Data Rates for Globa Evolution.

39. NFC – Near field communication.

40. OTG – On-the-go.

41. S-LCD – Super Liquid Crystal Display.

42. O.S – Operating system.

43. SNS – Social network service.

44. H.S – HOTSPOT.

45. P.O.I – Point of interest.

46. GPS – Global Positioning System.

47. DVD – Digital Video Disk.

48. DTP – Desk top publishing.

49. DNSE – Digital natural sound engine.

50. OVI – Ohio Video Intranet.

51. CDMA – Code Division Multiple Access.

52. WCDMA – Wide-band Code Division Multiple Access.

53. GSM – Global System for Mobile Communications.

54. DIVX – Digital internet video access.

55. APK – Authenticated public key.

56. J2ME – Java 2 micro edition.

57. SIS – Installation source.

58. DELL – Digital electronic link library.

59. ACER – Acquisition Collaboration Experimentation Reflection.

60. RSS – Really simple syndication.

61. TFT – Thin film transistor.

62. AMR - Adaptive Multi-Rate.

63. MPEG – moving pictures experts group.

64. IVRS – Interactive Voice Response System.

65. HP – Hewlett Packard.

Do we know actual full form of some words?


66. News paper - North East West South past and present events report.

67. Chess - Chariot, Horse, Elephant, Soldiers.

68. Cold - Chronic Obstructive Lung Disease.

69. Joke - Joy of Kids Entertainment.

70. Aim - Ambition in Mind.

71. Date - Day and Time Evolution.

72. Eat - Energy and Taste.

73. Tea - Taste and Energy Admitted.

74. Pen - Power Enriched in Nib.

75. Smile - Sweet Memories in Lips Expression.

76. etc - End of Thinking Capacity.

77. OK - Objection Killed_

78. Or - Orl Korec (Greek Word)

79. Bye - Be with you Every time.

Reset form in ionic 2 | ionic 3 in ionic 2 | ionic 3 | ionic 4 | angular2 | angular4

First add below code in your TS file :


import { Component} from ‘@angular/core’;

import { FormBuilder, FormGroup } from ‘@angular/forms’;


export class YourPage {

  public commentForm  : FormGroup;

  constructor(public _FB: FormBuilder) {

           this.commentForm  = _FB.group({

           comment: Validator.feedCreateValidator

      });

   }

  resetForm()
  {
      this.commentForm.reset();
  }



}

Note : Just call “resetForm()” method from your template. It will reset your form.

This will reset your form data.

Update view data based on model change in ionic 2 | ionic 3 in ionic 2 | ionic 3 | ionic 4

This is very easy to do, Please add below code in your TS file :

import { Component, NgZone} from ‘@angular/core’;

constructor(public zone: NgZone) {

        this.zone.run(() => {

       // yor code goes here

              });

}


This will update variable data when model change. 

Allow users to select and copy text in ionic 2 | ionic 3 in ionic 2 | ionic 3 | ionic 4

First, add this (selectable) class in your app.scss file. For specific page include in your page.scss file.

.selectable {

-webkit-user-select: text;

-moz-user-select: text;

-ms-user-select: text;

user-select: text;

}


After this please add “selectable” class to individual elements in the app or to ionic elements using the ngClass/class attribute.  

Eg :

<ion-card-content ngClass=”selectable”>

    <p  [innerHTML]=”item.body”></p>

  </ion-card-content>



Other Eg :

<ion-content padding ngClass=”selectable”>

This will allow your users to select and copy text from within your Ionic 2, Ionic 3, Ionic 4 app. 


\n to break line in ionic 2 | ionic 3 in ionic 2 | ionic 3 | ionic 4 | angular2 | angular4

To break line by "\n" you can use these style in your style (SCSS) file :

.class_name {
  white-space: pre-line;
}

This css convert \n to break line. Try this. It works for me.

node_modules/@ionic-native/core/index”‘ has no exported member ‘ionicnativeplugin’

I have found the solution, IonicNativePlugin was added in newer version of ionic-native/core, so I had to uninstall this one and install the newest one. This saved me a lot of time. I just did a

npm uninstall --save @ionic-native/core
npm install --save @ionic-native/core@latest

OR


Uninstall and add again plugin :


ionic plugin rm cordova-plugin-network-information

ionic plugin add –save cordova-plugin-network-information


Now check code by build again in your project.

Slide left right transition/animation in ionic 2 | ionic 3 | ionic 4 | angular2 | angular4

Please add below lines in your TS file :


import { Component, trigger, transition, style, animate } from ‘@angular/core’;

@Component({

selector: ‘page-name’,

animations: [

trigger(

‘slideAnimation’, [

transition(‘:enter’, [

style({transform: ‘translateX(100%)’, opacity: 0}),

animate(‘500ms’, style({transform: ‘translateX(0)’, opacity: 1}))

]),

transition(‘:leave’, [

style({transform: ‘translateX(0)’, opacity: 1}),

animate(‘500ms’, style({transform: ‘translateX(100%)’, opacity: 0}))

])

]

)

]

})




Add below lines in your template file :


<ion-row [@slideAnimation]>

<ion-col col-12>

My data which will slide left and right

</ion-col>

</ion-row>




If not work in iOS (mobile) follow below steps :


Just install web-animations-js

$ npm install –save web-animations-js
Put below code in your TS file :-

import ‘web-animations-js/web-animations.min’;