Monday, 27 June 2016

GA2- Resource URL

GoogleAnalytics-2
----------------
Resource URL
============


Google AdWords Help Center: http;//adwords.google.com/support How-to’s and troubleshooting for your AdWords account linked to Analytics
Google Analytics Help Center: http://www.google.com/support/analytics Analytics specific questions
Google Analytics Blog: http://analytics.blogspot.com/ Latest news, tips and resources from the Google Analytics team.
Marketing optimization at Conversion University: http://www.google.com/Analytics/conversionuniversity.html Learn about marketing and content optimization and read web analytics tips
Analytics User Forum: http://groups.google.com/group/analytics-help Tips, tricks, experience, advice and bulletin board for questions between Analytics users
Match Types: http://adWords.google.com/support/bin/answer.py?answer=26918 Definitions of the different match types
Goals and Funnels for Dynamic Sites: http://adwords.google.com/support/bin/answer.py?answer=26918 Description of dynamic values
Advanced Goals: http://adWords.google.com/support/bin/topic.py?topic=8151 In depth FAQ for setting up advanced goals
Analytics Glossary: http://www.google.com/support/Analytics/bin/static.py?page=glossary.h tml Look up Google Analytics terminology

-----------------

Glossary:
=========

URL: The website’s address. Ex: http://www.google.com
Sub-domain: A directory that falls within another directory.
Goal: A page within your site that the visitor reaches once they’ve completed the activity you desire.
Ex: A Thank You page
Conversion: A completed goal is considered a conversion.
Funnel: The series of pages a visitor goes to on their way to your goal page.
Abandonment Point: The page a user visited after leaving a step in your funnel
Entrance Point: The page a user visited just before entering your funnel. This isn’t always your
homepage.
Referral: The source that sends visitors to your site. This can be a search engine, link on another site,
an ad, etc
Orders: The individual conversions completed on your goal page. Ex: A visitor may make four
donations on your site at once, but they only count as one conversion because they only reach the
goal page once. However, that would count as four individual orders.
Dynamic URL: A URL that results from the search of a website or the URL of a website that runs a
script.


Match Types: There are three match types that allow you to control how your funnel steps and goal
page will be matched with the URLs your users visit
Flash: Web design software which creates web animations that run on your website.
Auto-Tagging: An option in your linked AdWords account that lets you tag all keywords in your
account so that Analytics can report back on their performance. This saves time and keeps you from
having to manually tag individual keywords.
E-commerce: The buying and selling of goods and services, and the transfer of funds, through digital
communications typically using a shopping cart.
Cookie: A small amount of text data given to a web browser by a web server. For example, a
protected site may store a temporary identifier in a cookie after you successfully log in,
indicating that you are an authorized user.
3rd Party Shopping Cart: Another website that hosts your online shopping. Ex: Cafepress is the 3rd
Party shopping cart for Cash for Critters.
Date Range: The start and end dates of your reporting time period.
Visits: A defined quantity of visitor interaction with a website
Page views: Any file or content delivered by a web server that would generally be considered a web
document. Each time a file defined as a page is served, a pageview is registered by Google Analytics.
Source: T he means by which a user reached your site

Setup - Google Analytics - Tracking metrics & statics


Set up Analytics tracking
==========================


Learn how to set up tracking for websites, apps, or other devices.
Find your tracking ID or tracking code snippet

To set up Google Analytics tracking, you’ll usually need either your Analytics tracking ID or the entire Javascript tracking code snippet. This corresponds to your Analytics property. To find the tracking ID and code snippet:

     step1: Sign in to your Analytics account. url ->https://analytics.google.com  user id -> ganapathi@gmail.com
     step2: Select the Admin tab.
     step3: Select an account from the drop-down menu in the ACCOUNT column.
     step4: Select a property from the drop-down menu in the PROPERTY column.
     step5: Under PROPERTY, click Tracking Info > Tracking Code.

e-g

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-76621271-1', 'auto');
  ga('send', 'pageview');

</script>


Analytics ID is UA-76621271-1.It's unique for every account.


 set up tracking:

Static website
Dynamic website
SPA (Ecom) Website
Web-hosting service (you don’t manage source code)
Website using Google Tag Manager
Mobile apps (Android, iOS)
Internet-connected device


Static website
===============


A static website is one in which the page HTML is NOT generated using a programming language or interface such Python, Ruby, PHP, etc. To collect data, you must copy and paste the Analytics tracking code into the source code on every web page you wish to track.

    Once you have the Javascript tracking code snippet for your property, copy the snippet exactly without editing it.
    Paste your tracking code snippet (unaltered, in its entirety) before the closing </head> tag on every web page on your site you wish to track.


Dynamic website
=============
==

A dynamic website is one in which the HTML is generated using a programming language such as Python, Ruby, PHP, etc. To collect data, you must include the Analytics tracking code in the source code on every web page you wish to track. You can use a common include or template to push the tracking code dynamically into every page.

    Once you have the Javascript tracking code snippet for your property, copy the snippet exactly without editing it.
    Paste your tracking code snippet into its own include file, then include it in your page header, so that the snippet appears before the closing </head> tag on every web page on your site you wish to track.
eg php site------>

<?php include_once("analyticstracking.php") ?>

Single Page Application Dynamic website - Ecom
===============================================

Once you have the Javascript tracking code snippet for your property, copy the snippet exactly without editing it.
    Paste your tracking code snippet (unaltered, in its entirety) before the closing </head> tag on every web page on your site you wish to track in index.html. It will work on All over the web sites.


GTM Setup and installation
===========================

To get started managing your tags using Google Tag Manager:

    Go to tagmanager.google.com to create a Google Tag Manager account (or to access an existing account ganapathi@gmail.com).
    Create a container for your site or app.
    For websites: Add the container snippet to your site while removing any existing tags.
    For mobile apps: Implementation of Tag Manager for mobile apps is done in conjunction with the Firebase SDK. See the Android or iOS documentation for more information.



GTM - Creating an account and container
----------------------------------------


    From the Home/All Accounts page in Google Tag Manager, click Create Account. (You can always get to this screen by clicking on the Tag Manager icon in the far upper left corner of the screen.)
    Enter an account name, optionally select the checkboxes to enable sharing data anonymously with Google and others and click Continue.
    Enter a container name when prompted in the Setup Container dialog. Select the container for Web, iOS, or Android. If setting up a mobile container, select whether you're using the Firebase SDK or one of the legacy SDKs. Click Create.
    Review the Terms of Service and click Yes if you agree to those terms.
    When your new container first loads, you will be prompted with the web container installation code snippet, or to get started with Tag Manager as part of the SDK for your chosen mobile platform. Click OK to clear this dialog (you can always set up your container first and install the container snippet or SDK later.)

GTM - Adding the container to web pages (UA tracking code is reduntant- use any once GA or GTM tracking code)
=============================================================================================================
Near the top of your container's home screen, you will see your container ID number (formatted as "GTM-XXXXX"). Click it to launch the Install Google Tag Manager box.
Copy and paste the code snippet into your website. Paste this code so that it appears immediately after the opening <body> tag on every page on your site. 



eg
<!-- Google Tag Manager -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-NF7CSX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-NF7CSX');</script>
<!-- End Google Tag Manager -->



At this point, you’ve set up your account and installed the tracking code on every
page of your web site so that Analytics can start gathering data on your site. After
just 24 hours, you’ll be able to login to your Analytics account in AdWords and see
results about your visitors!

HTML Table view - > 3x2 table in div and css3 center content

HTML Table view - > 3x2 table in div and css3 center content:

--------------------------------------------------------------------------------------------


HTML:
------

 <li class="ie-browser">
            <div class="ie_icon_browser">
                <img src="images/Google_browser_icon.png" alt="chrome" />
                <span class="ie-chrome">chrome</span>
            </div>
            <div class="ie_icon_browser">
                <img src="images/Firefox_browser_icon.png" />
                <span class="ie-ff">firefox </span>
            </div>
            <div class="ie_icon_browser">
                <img src="images/Safari_browser_icon.png" alt="safari" />
                <span class="ie-safari">safari</span>
            </div>
  </li>


css:
----

.ie_icon_browser {
    float: left;
    width: 33%;
}

.ie-browser:after {
    clear: both;
    display: block;
    content: '';
}

.ie-browser {
    width: 65%;
    margin: 0px auto;
}

li.ie-browser .ie_icon_browser span {
    display: block;
}

Friday, 13 May 2016

Forbidden-403_erro_image

PHP image not fount 404 err:
 -----------------------------------------
Find out the web server user

open up terminal and type lsof -i tcp:80

This will show you the user of the web server process Here is an example from a raspberry pi running debian:

COMMAND   PID     USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
apache2  7478 www-data    3u  IPv4 450666      0t0  TCP *:http (LISTEN)
apache2  7664 www-data    3u  IPv4 450666      0t0  TCP *:http (LISTEN)
apache2  7794 www-data    3u  IPv4 450666      0t0  TCP *:http (LISTEN)
The user is www-data

If you give ownership of the web files to the web server:

chown www-data:www-data -R /opt/lamp/htdocs
And chmod 755 for good measure:

chmod 755 -R /opt/lamp/htdocs
Let me know how you go, maybe you need to use 'sudo' before the command, i.e. sudo chown www-data:www-data -R /opt/lamp/htdocs

if it doesn't work, please give us the output of: ls -al /opt/lamp/htdocs

shareimprove this answer
answered Sep 10 '13 at 17:06

Joeme
32229


http://stackoverflow.com/questions/18724718/error-403-in-loading-resources-like-css-and-js-in-my-index-php

jquery POPUP - with colse and Esc close popup

HTML,js,css full code:
-----------------------------------

<!DOCTYPE html>
<html lang="en-US">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="robots" content="all,index,follow" />

        <title>Create Mobile Optimized Modal Window</title>
        <meta name="description" content="Code a basic responsive popup window without using a plugin, that works great on desktop and mobile." />

        <style>
              @import url('http://fonts.googleapis.com/css?family=Open+Sans:400,600,700');

            *, *:before, *:after { margin: 0; padding: 0; box-sizing: border-box; }
            body { background: #2F2556; color: #B9B5C7; font: 14px 'Open Sans', sans-serif; }

            /* You can safely remove the next two lines */
            .top { padding-right: 20px; background: #261F41; text-align: right; }
            a { color: rgba(255,255,255,0.6); text-transform: uppercase; text-decoration: none; line-height: 42px; }
           
            h1 { padding: 60px 0; font-weight: 400; text-align: center; }
            p { margin: 0 0 20px; line-height: 1.5; }
           
            .main { margin: 0 auto; padding: 40px 20px; max-width: 960px; font-size: 19px; line-height: 30px;}
            .main a { color: #DB7580; text-transform: none; }
           
            /* Styling the Popup Window */
            .popup-trigger { display: block; margin: 0 auto; padding: 20px; max-width: 260px; background: #4EBD79; color: #fff;
                             font-size: 18px; font-weight: 700; text-align: center; text-transform: uppercase; line-height: 24px; cursor: pointer; }
              .popup {display: none; position: absolute; top: 100px; left: 50%; width: 700px; margin-left: -350px; padding: 50px 30px;
                      background: #fff; color: #333; font-size: 19px; line-height: 30px; border: 10px solid #150E2D; z-index: 9999;}
              .popup-mobile {position: relative; top: 0; left: 0; margin: 30px 0 0; width: 100%;}       
              .popup-btn-close {position: absolute; top: 8px; right: 14px; color: #4EBD79; font-size: 14px; font-weight: bold; text-transform: uppercase; cursor: pointer;}   
          </style>
           
    </head>

    <body>
   
        <div class="top">
            <a href="http://stanhub.com/create-responsive-popup-modal-window-jquery-no-plugin/">Back to the article (free download)</a>
        </div>

        <h1><a href="http://stanhub.com/create-responsive-popup-modal-window-jquery-no-plugin/">Simple Responsive Popup Window</a></h1>
   
        <a class="popup-trigger">Open Pop Up</a>
       
        <div class="main">
          This is an example of a minimal mobile-friendly modal window. It is developed without using a plugin and with just a few lines of jQuery. Resize your browser to test how it behaves on mobile. <br><br> The functionality is very basic, so you would probably have to built upon it regarding your project needs. Feel free to use this script in any personal or commercial projects. To <a href="http://stanhub.com/create-responsive-popup-modal-window-jquery-no-plugin/">download this demo</a>, please go to the main article on Stanhub.
        </div>
       
        <div class="popup">
          Madrid is a city in Europe and the capital and largest city of Spain. The population of the city is almost 3.2 million and that of the Madrid metropolitan area, around 6.3 million. <br><br>It is the third-largest city in the European Union, after London and Berlin, and its metropolitan area is the third-largest in the European Union after Paris and London. The city spans a total of 604.3 km2 (233.3 sq mi).
          <span class="popup-btn-close">close</span>
        </div>
       
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
       
        <script>
        // Popup Window
        var scrollTop = '';
        var newHeight = '100';

        $(window).bind('scroll', function() {
           scrollTop = $( window ).scrollTop();
           newHeight = scrollTop + 100;
        });
       
        $('.popup-trigger').click(function(e) {
           e.stopPropagation();
         if(jQuery(window).width() < 767) {
           $(this).after( $( ".popup" ) );
           $('.popup').show().addClass('popup-mobile').css('top', 0);
           $('html, body').animate({
                scrollTop: $('.popup').offset().top
            }, 500);  
         } else {
           $('.popup').removeClass('popup-mobile').css('top', newHeight).toggle();
         };
        });
       
        $('html').click(function() {
         $('.popup').hide();
        });

        $('.popup-btn-close').click(function(e){
          $('.popup').hide();
        });

        $('.popup').click(function(e){
          e.stopPropagation();
        });
        // escape btn to close in jquery popup
         window.onkeydown = function( event ) { if ( event.keyCode === 27 ) { $('.popup').hide(); console.log( 'escape pressed' ); } };
        </script>
    </body>
</html>

Detect IE browser apply conditions

Detect IE browser apply conditions :
======================

All version of IE and(windows) OS support.


<script>
    if (window.ActiveXObject || "ActiveXObject" in window) {
        alert("IE")
    }

 else{
        alert('Non-IE');
     }
    </script>

Text overflow at right side .....


Text overflow at right side of page make ..... for continues....

CSS:
=======
.class-left{
    text-overflow: ellipsis;
}

html:=
=======

<div>
<div class="class-left">aaaaaaaaaaaaa></div><div class="right">LINK</div>

Sunday, 24 April 2016

Sending data to Google docs from your web page

google spread Sheets as DB: 
=======================
Google Sheets as a Database – INSERT with Apps Script using POST/GET methods (with ajax eg)
-----------------------------------------------------------------------------------------------------------------------

goto Google.drive.com

Click->New-> google sheets

==> open new untitled spreadsheet

Name on your own ( Presale Email Subscribers)

Enter fields you want to store from Form

==> eg .timestamp, name, Email, phone,etc....


In Menu(sheet) ->Tools->Script Editor click

It open new Gogole app script editor with code.gs fine name

Enter project name ( Form Script)

Mention Sheet name in this script is mandatory. Eg. Sheet1

Enter the below code

------------------------
//  1. Enter sheet name where data is to be written below
        var SHEET_NAME = "Sheet1";

//  2. Run > setup
//
//  3. Publish > Deploy as web app
//    - enter Project Version name and click 'Save New Version'
//    - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)
//
//  4. Copy the 'Current web app URL' and post this in your form/script action
//
//  5. Insert column names on your destination sheet matching the parameter names of the data you are passing in (exactly matching case)

var SCRIPT_PROP = PropertiesService.getScriptProperties(); // new property service

// If you don't want to expose either GET or POST methods you can comment out the appropriate function
//function doGet(e){
//  return handleResponse(e);
//}

function doPost(e){
  return handleResponse(e);
}

function handleResponse(e) {
  // shortly after my original solution Google announced the LockService[1]
  // this prevents concurrent access overwritting data
  // [1] http://googleappsdeveloper.blogspot.co.uk/2011/10/concurrency-and-google-apps-script.html
  // we want a public lock, one that locks for all invocations
  var lock = LockService.getPublicLock();
  lock.waitLock(30000);  // wait 30 seconds before conceding defeat.

  try {
    // next set where we write the data - you could write to multiple/alternate destinations
    var doc = SpreadsheetApp.openById(SCRIPT_PROP.getProperty("key"));
    var sheet = doc.getSheetByName(SHEET_NAME);

    // we'll assume header is in row 1 but you can override with header_row in GET/POST data
    var headRow = e.parameter.header_row || 1;
    var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
    var nextRow = sheet.getLastRow()+1; // get next row
    var row = [];
    // loop through the header columns
    for (i in headers){
      if (headers[i] == "Timestamp"){ // special case if you include a 'Timestamp' column
        row.push(new Date());
      } else { // else use header name to get data
        row.push(e.parameter[headers[i]]);
      }
    }
    // more efficient to set values as [][] array than individually
    sheet.getRange(nextRow, 1, 1, row.length).setValues([row]);
    // return json success results
    return ContentService
          .createTextOutput(JSON.stringify({"result":"success", "row": nextRow}))
          .setMimeType(ContentService.MimeType.JSON);
  } catch(e){
    // if error return this
    return ContentService
          .createTextOutput(JSON.stringify({"result":"error", "error": e}))
          .setMimeType(ContentService.MimeType.JSON);
  } finally { //release lock
    lock.releaseLock();
  }
}

function setup() {
    var doc = SpreadsheetApp.getActiveSpreadsheet();
    SCRIPT_PROP.setProperty("key", doc.getId());
}

Make to doPost() or doGet()


Click on the Save icon. Set the dropdown in the nav bar to 'setup’ and click on the right-pointing triangle to its left to run this function. It should show 'Running function setup’ and then put up a dialog 'Authorization Required’. Click on Continue. In the next dialog 'Request for permission - Formscript would like to’ click on Accept.

In the menus click on File > Manage Versions… We must save a version of the script for it to be called. In the box labeled 'Describe what has changed’ type 'Initial version’ and click on 'Save New Version’, then on 'OK’.

Back to the menus: click on Resources > Current roject’s triggers. In this dialog click on 'No triggers set up. Click here to add one now’. In the dropdowns select 'doPost’, 'From spreadsheet’, and 'On form submit’, then click on 'Save’.

Back to the menus: click on Publish > Deploy as web app… For 'Who has access to the app:’ select 'Anyone, even anonymous’. Leave 'Execute the app as:’ set to 'Me’ and Project Version to '1’. Click the 'Deploy’ button.

A dialog should appear announcing 'This project is now deployed as a web app’. Copy the Current web app URL from the dialog; it should look something like:

https://script.google.com/macros/s/AKfycbw6RTOxn5OT_BIw9Nl_3KoFSXEQEbiKSZCLyombb1YqkGfRKUSz/exec
Click OK.

Now go back to google-sheet.js and replace 'SCRIPT URL GOES HERE’ with the URL copied from the dialog.

Display or refresh the index.html web page. Enter data into the four fields and click on the 'Send’ button. Within a few seconds that data should appear in your Google sheet. If your browser is Google Chrome, right-click in the web page and click on Inspect Element > Console. It should show:

Hooray, it worked!
- Object
success
- Object
Well done! You can now modify this form and drop it into any web page to collect–at no cost–responses from those who visit your page. With a little research and effort you may be able to get Google Apps to email every time someone submits your form.

I plan to use it to collect names and email addresses of those who visit an MVP page, where the “product” is just a description of the SaaS site I have in mind. I may also use it on a stand-alone blog where I do not want to let readers post comments, but I would rather they send them to me so I can screen, remove spam, edit, and comment on them before putting them up.



full code for index.html and sheet.js
---------------------------------------


<!DOCTYPE html>
<html lang='en'>
  <head>
    <meta charset='utf-8'>
    <meta content='IE=edge' http-equiv='X-UA-Compatible'>
    <meta content='width=device-width, initial-scale=1' name='viewport'>
  </head>
  <body>
    <!-- Contact Form - sent to a Google Sheet -->
    <form id='foo'>
      <p>
        <label>Name</label>
        <input id='name' name='name' type='text'>
      </p><p>
        <label>Email Address</label>
        <input id='email' name='email' type='email'>
      </p><p>
        <label>Phone Number</label>
        <input id='phone' name='phone' type='tel'>
      </p><p>
        <label>Message</label>
        <textarea id='message' name='message' rows='5'></textarea>
      </p>
        <div id='success'></div>
        <button type='submit'>Send</button>
    </form>

  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  <!-- Custom Theme JavaScript -->
  <script>

// Variable to hold request
var request;

// Bind to the submit event of our form
$("#foo").submit(function(event){

    // Abort any pending request
    if (request) {
        request.abort();
    }
    // setup some local variables
    var $form = $(this);

    // Let's select and cache all the fields
    var $inputs = $form.find("input, select, button, textarea");

    // Serialize the data in the form
    var serializedData = $form.serialize();

    // Let's disable the inputs for the duration of the Ajax request.
    // Note: we disable elements AFTER the form data has been serialized.
    // Disabled form elements will not be serialized.
    $inputs.prop("disabled", true);

    // Fire off the request to /form.php
    request = $.ajax({
        url: "https://script.google.com/macros/s/AKfycbxNDXmWaInWS-aHhBB8XgSbxjR-kk0UI0C05g3pUQ2G8KghHPU/exec",
        type: "post",
        data: serializedData
    });

    // Callback handler that will be called on success
    request.done(function (response, textStatus, jqXHR){
        // Log a message to the console
        console.log("Hooray, it worked!");
        console.log(response);
        console.log(textStatus);
        console.log(jqXHR);
alert("success");

location.reload();
    });

    // Callback handler that will be called on failure
    request.fail(function (jqXHR, textStatus, errorThrown){
        // Log the error to the console
        console.error(
            "The following error occurred: "+
            textStatus, errorThrown
        );
    });

    // Callback handler that will be called regardless
    // if the request failed or succeeded
    request.always(function () {
        // Reenable the inputs
        $inputs.prop("disabled", false);
    });

    // Prevent default posting of form
    event.preventDefault();
});

</script>
</html>

Tuesday, 12 April 2016

Ng-style-Inline-Background-image == Use ng-Directive

To set background image for div in INLINE:
===========================================

<div ng-style="{'background': 'url({{images.logo}})'}"> </div>

Error:1
=======

In Ng inline style not appear in IE browser. So use ng-style instead of style.

Error:2
=======
ng-style="{background: url({{images.logo}})}"  is ERROR

use ' (quote) to use css 'key':'value'.

 ng-style="{'background': 'url({{images.logo}})'}">



SOLN + Additional Value:
========================

Use ng-hreg instead of href while using dynamic value.

<a ng-href="{{URL.path}}">ANCHOR LINK </a>

To avoid cross browser and IE related error. Use ng-directives.

Saturday, 2 April 2016

Use Multiple Mail ID for Testing.

Register user favorites name with @yopmail.com

Eas to access inbox from yopmail.com portal without password.

@note: Insecure port. Inbox can accessable if know username@yopmail.com

yopmial @yahoo product

No condition checkup for creation.

NG-Form Validation in controlle and service call


html-view:
==========

<form name="formname" ng-sbumit="ctrl.ctrlmethod(ctrl.model[formmodel], formname)" novalidate>
<label>Name</label>
<input type="text" name="name" ng-model="ctrl.model[formmodel].name" ng-pattern="/^[a-z ,.'-]+$/i" required />
<span ng-show="ctrl.crtlflagForm && formname.name.$error.required" class="ngMessagesClass"> Field should not be empty </span>
<div ng-messages="formname.name.$error" class="ngMessagesClass">
<div ng-message="name"> Invalid name/email format </div>
</div>
</form>


**[formmodel]- here taking all form values
For characters only ===> ng-pattern="/^[a-z ,.'-]+$/i" 
For staring with 789+9digits number ng-pattern="/^[789]\d{9}$/"
For ng-minlength, ng-maxlength


form.controller.js:
===================

 self.ctrlmethod = function(formdata, requiredvalidateForm) {

      self.formdataDetails = formdata;
      console.log(self.formdataDetails);
      self.requiredvalidateForm = true;
      var datalength = _.keys(self.formdataDetails).length;

      if (datalength === 1) {

        formService.serviceCall(self.formdataDetails).then(function(response) {

          if (response.statusCode === 200) {
            ngDialog.open({
              scope: $scope,
              template: 'success-popup.html'
            });
          }
          self.model = {};
          self.requiredvalidateForm = false;
          console.log("inCtrl " + response);
        }, function() {
          console.log("Some error occurred. Please check again");
        });

      }
    }


form.service.js
================

 self.serviceCall = function(userFormDetails) {
        var requestData = userFormDetails;
        console.log(requestData);
        var deferred = $q.defer();
        $http.post(config.Url.API, requestData).then(function(response) {
          if (response) {
            deferred.resolve(response.data);
          }
        });
        return deferred.promise;
      };


index.html/footer.html:      IN one of HTML/view Add template code
======================

<script type="text/ng-template" id="success-popup.html">
    <div class="success-popup">Nice to discuss with you!</div>
</script>

Redux vs Redux Toolkit vs React Context

  These are often confused. Feature Redux Redux Toolkit Context API Purpose State management Simplifies Redux Shares values in Rea...