What is AngularJS?

AngularJS is an open source web application framework. It was originally developed in 2009 by Misko Hevery and Adam Abrons. It is now maintained by Google. Its latest version is 1.4.3.


Definition of AngularJS as per documentation is as follows 


AngularJS is a structural framework for dynamic web apps. It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. Angular's data binding and dependency injection eliminate much of the code you currently have to write. And it all happens within the browser, making it an ideal partner with any server technology.

Advantages of  AngularJS


1. AngularJS is a powerful JavaScript based development framework to create SPA (single page application).
2. AngularJS provides developers options to write client side application and it uses MVC framework.
3. AngularJS is cross-browser compliant.
4. AngularJS is open source, completely free, and used by thousands of developers around the world.





Core Features


Data-binding - It  automatically synchronizes data between model and view components.

Scope − These are objects that refer to the model. They act as a glue between controller and view.

Controller − These are JavaScript functions that are bound to a particular scope.

Services − AngularJS come with several built-in services for example $http to make a 
XMLHttpRequests. These are singleton objects which are instantiated only once in app.

Filters − These select a subset of items from an array and returns a new array.

Directives − Directives are markers on DOM elements (such as elements, attributes, css, and more). These can be used to create custom HTML tags that serve as new, custom widgets. AngularJS has built-in directives (ngBind, ngModel...)

Templates − These are the rendered view with information from the controller and model. These can be a single file (like index.html) or multiple views in one page using "partials".

Routing − It is concept of switching views.

Model View Whatever − MVC is a design pattern for dividing an application into different parts (called Model, View and Controller), each with distinct responsibilities. AngularJS does not implement MVC in the traditional sense, but rather something closer to MVVM (Model-View-ViewModel). The Angular JS team refers it humorously as Model View Whatever.

Deep Linking − Deep linking allows you to encode the state of application in the URL so that it can be bookmarked. The application can then be restored from the URL to the same state.

Dependency Injection − AngularJS has a built-in dependency injection subsystem that helps the developer by making the application easier to develop, understand, and test.


The AngularJS Components

The AngularJS framework can be divided into following three major parts

ng-app − This directive defines and links an AngularJS application to HTML.

ng-model − This directive binds the values of AngularJS application data to HTML input controls.

ng-bind − This directive binds the AngularJS Application data to HTML tags.


Get All WordPress Navigation Menus list

If you are trying to create a new options in metaboxes oo in theme options to get all the wordpress menu list.Use the Below code.

<?php
$display_menus = get_terms( 'nav_menu' );
foreach($display_menus as $menu)
{
echo $menu->name;
}
?>

!Important Update Your All in One SEO Pack WordPress Plugin Now

All wordpress sites are getting hacked for the users who are using older version of  " All in One Seo Plugin".  The code in the plugin had couple of security issues that enabled hackers to:
(1) Conduct privilege escalation
(2) Cross site scripting (XSS) attacks
So to Protect your Website Update to latest version Now

How to reduce your site load time in WordPress?

By using different plugins, adding larger number of scripts in your theme and using larger images may lead in increasing the site load time. To avoid this we need to follow few steps.

1.Check your Hosting quality.
2.Use sprites for background images in Css.
3.Use Best and quality plugins.
4.Try to reduce external scripts running on the site.
5.Keep you custom scripts in footer.php.
6.Keep you main style sheet at top of all scripts and links.

Finally us this code, Paste this code in your site ".htaccess".

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/html M3600
    ExpiresByType text/css M3600
    ExpiresByType application/x-javascript M3600
    ExpiresByType image/bmp M3600
    ExpiresByType image/gif M3600
    ExpiresByType image/x-icon M3600
    ExpiresByType image/jpeg M3600
</IfModule>

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/css application/x-javascript text/plain text/xml image/x-icon
</IfModule>

(Note: Backup up your .htaccess )

How to Assign Category to a Post Automatically

Copy and Paste the Below code in you theme functions.php.

 function auto_add_category ($post_id = 0) {
     if (!$post_id) return;
     $tag_categories = array ( //  add multiple items as shown 'Tag Name' => 'Categroy Name'
       'toys' => 'Kids',
       'apple' => 'Fruits',
     );
     $post_tags = get_the_tags($post_id);
     foreach ($post_tags as $tag) {
       if ($tag_categories[$tag->name] ) {
         $cat_id = get_cat_ID($tag_categories[$tag->name]);
         if ($cat_id) {
           $result =  wp_set_post_terms( $post_id, $tags = $cat_id, $taxonomy = 'category', $append = true );
         }
       }
     }
   }
add_action('publish_post','auto_add_category');
?>