What is Angularjs?
Angular.js is an open-source framework development and maintained by google it was initail released in 2009 and angularJs 1.4.3 stable released july,15,2015.Angularja is a Model View Whatever(MVW) Framework.It aims to simplife both the development and testing of such application by providing a framework for Client-side model-view-controller(MVC) and Model-View-viewmodel (MVVM) architectures.
What is MVC?
Model, View, Controller (MVC) is a pattern for organising code in an application to improve maintainabilityWhat is MVVM
Model-View ViewModel(MVVM) is similar to Model-View Controller(MVC).The controller is replaced with a View Model.
1). Include AngularJS Script
first you can download the angular.js file and add it to your veiw script. you can download angularJs file angularjs.org. After download the angularjs file to add file in your view script file.you can try this code for adding angularjs file in your view script.
<!DOTYPE html>
<html>
<head>
<title>AngularJs Adding file</title>
<script type="javascript" src="js/angular.min.js"></script>
</head>
<body>
<div>
<p>you file successfully add angular.js file in your view script </p>
</div>
</body>
</html>
Save the file the "index.html" and when you save the file you can run. after run you index.html file the browser show this message on your browser screen, "you file successfully add angular.js file in your view script"
so watch this video to help you that how to add angularjs file in view script.
2)Attribute ng-app
ng-app attribute to a module name in html tag. ng-app is a angular directive and ng-app using for binding.
In this example. we can learn add directive in our html code and print hello world.
- We can use ng-app directive in html tag,
- we can use ng-app directive in body tag also.
- and we can use ng-app directive in div element.
1)Example One. Here we are using ng-app in html tag.
<!DOCTYPE html>
<html ng-app>
<head>
<title>Angular ng-app module Bindind</title>
<script src="js/angular.min.js"></script>
</head>
<body>
{{"Hello World!...."}}
</body>
</html>
2)Example Two.Here we are using ng-app in body tag.
<!DOCTYPE html>
<html>
<head>
<title>Angular ng-app module Bindind</title>
<script src="js/angular.min.js"></script>
</head>
<body>
{{"Hello World!...."}}
</body>
</html>
3)Example Three.Here we are using ng-app in Div element.
<!DOCTYPE html>
<html>
<head>
<title>Angular ng-app module Bindind</title>
<script src="js/angular.min.js"></script>
</head>
<body>
<div ng-app>
{{"Hello World!...."}}
</div>
</body>
</html>
Watch this video.
So friend wait next step.
As a beginner to angularjs this post helps me to learn about the framework from the basics, Thanks for the useful update!! Bookmarked!!!
ReplyDeletehttp://www.credosystemz.com/training-in-chennai/best-angularjs-training-in-chennai/