0

Lets get started with AngularJS

Lets get started with AngularJS

Hi Guys, lets get started with your first AngularJS program.  Learn how are create web apps with AngularJS with step by step. Going to cover the features of AngularJS in next posts. This is the beginning of AngularJS storm.

Here you will understand the how to install and run your first HelloWorld example.

Why AngularJS:

  •  It provides structure to app
  • Easy to learn
  • Reduces the coding effort and time
  • Suitable for single page apps
  • New vocabulary for HTML markups
  • MVC pattern
  • Has more than 800 modules
  • Has own template engine
  • Read more @ https://angularjs.org/

There are some frameworks likes jQuery, BackboneJS, KnockoutJS etc. ,but angularJS has many features than others.

Read the differences between all frameworks here 

How to install AngularJS:

  • Create a new web page and include Angular library(https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.js) in it.
  • Create app.js and include in our web page.
  • Add ng-app and ng-controller to that document as shown below.

Here,

-> ng-app is the directive of AngularJS  and DOM reference to the app.

->  We create an app with the value of ng-app.

->ng-controller holds the control of our app.

->  Create a controller in app.js with with the value of ng-controller.

Your app.js will look something like this.

Scope($scope) is the glue between application controller and the view.  and its an object that refers to the application model.  All the scope values can explicitly used in view. Add our first key title and assign the value ‘Hello World!’ to it,

So, we can use title any where in the view with reference to $scope object.  Use {{}} brackets to display the contents of $scope object.

Look at the plunker  below

You will learn data bindings in next post and thanks for reading.

 

 

 

 

 

 

0

DataWeave – Intelligent Data for your Apps

DataWeave provides data in various sectors of web like data for coupons, weather updates, population, earthquakes etc..  Gives an easy access to APIs, dashboards, alerts and visualization.

Services

  1. Telecom Data API: Provides details of recharge coupons from various telecom operators across all circles.
  2. E-commerce price intelligence; Provides prices from various stores for the selected product, useful for comparison based websites.
  3. Coupons codes API: Provides coupon codes with their details from all online retailers.
  4. For more API features visit http://dataweave.in/apis

How to use DataWeave APIs

  • Sign up  and confirm your account with http://dataweave.in/ to access to all APIs
  • signup-dataweave

 

 

 

 

  • Grab API key from next page of sign up

How to use DataWeave API with PHP

An example usage of DataWeave APIs with PHP, here you can even use PHP cURL to parse the data.

The above code prints the data in PHP array, we can use it anywhere later.

I hope this post is helpful and thanks.

 

0

PHP function to get ID from YouTube URL

Use the following function to get the id from YouTube URL.

 How to use?

That’s all for now.

How to create your own jQuery Accordion

jquery accordion

 

DownloadDemo

Sometimes Accordions are very useful to display the full content in limited amount of space.  Accordions are the collapsible panels  that carry the content.

Click the titles to expand the content under it and click to collapse.  How to create a simple Accordion with jQuery.

First of all, Include the jQuery library if it has not already included. Then append the following markup in wherever you want to read up the Accordion.

Then add the basic styles for Accordion. To change the appearance, you can add or change the css properties.

And Finally jQuery

Ok. Coool?