What is the angularJs (Part1)


Hello World

History
1. Angular VS 1.0 release in 2012.
2. Developed by Miško Hevery, a Google employee.
Introduction
• It is JavaScript framework. It is library written in JavaScript.
• It 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.
• By default it supports MVVM or MVC (Model view Controller) design pattern.

Directives in Angular

The ng-app directive defines an AngularJS application.
The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.
The ng-bind directive binds application data to the HTML view.

Basic Sample Code for Angular Js

<!DOCTYPE html>
<html>
<head>
    <title></title>
	<meta charset="utf-8" />
    <script src="../Scripts/angular.min.js"></script>
</head>
<body>


<div ng-app="">


Name: <input type="text" ng-model="name" /> 

         <b> Hello: <span ng-bind="name"></span> </b>
    </div>


</body>
</html>

In above example ng-app directive tells AngularJS that the div element is the “owner” of an AngularJS application.
The ng-model directive binds the value of the input field to the application variable name.
The ng-bind directive binds the innerHTML of the paragraph (“b”) element to the application variable name.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.