Pages

Saturday, May 10, 2014

AngularJs Part - I

  • No Classes or IDs in the HTML to identify where to attach event listners
  • No event listeners or call backs
  • Web applications create their HTML by assembling and joining it with data on the server, and then shipping the finished pages up to the browser
  • In Angular js, the template and data get shipped to the browser to be assembled there.
  •  
<!

DOCTYPE html>

<

html ng-app>

<

head>


<title>Hello World, AngularJS - ViralPatel.net</title>


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>

</

head>

<

body>


<div ng-controller="HelloController">


<input ng-model='greeting.text'>


<p>{{greeting.text}}, World</p>


</div>


<script type="text/javascript">


function HelloController($scope) {

$scope.greeting = { text:
'hi' };

}


</script>

</

body>

</

html>

No comments:

Post a Comment