54-MVC Framework-Intoduction To AngularJS-Directives-expressions-data Types-Module and Controllers-20-02-2023
54-MVC Framework-Intoduction To AngularJS-Directives-expressions-data Types-Module and Controllers-20-02-2023
Web Applications
Web Applications
Web applications
Web Application Frameworks
MVC framework
Angular JS
Single Page Applications
Responsive Web Design
Google Apps for Work has Gmail, Google Docs, Google Sheets, Google
Slides, online storage and more. Other functionalities include online
sharing of documents and calendars. This lets all team members access
the same version of a document simultaneously.
written in Python
7 Django
Model View Template (MVC) architecture
PHP development frameworks
develop the web and mobile applications for small websites and big
8 Laravel
businesses
MVC support
React.js JavaScript library maintained by Facebook
9
near future called, React Fibre
written in PHP
13 CakePHP
model-controller-view and association data mapping
<script src="https://ajax.googleapis.com/ajax/libs/a
ngularjs/1.8.0/angular.min.js"></script>
<html ng-app><head>
<script src =
"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.0/ang
ular.min.js"></script>
</head><body><div><label>Name:</label>
<input type = "text" ng-model = "NameText" placeholder =
"Enter a name here">
<hr /><h1>Hello {{NameText}}!</h1>
</div></body></html>
27 R.Vijayani / Asso Prof / SITE / VIT
AngularJS Directives
AngularJS directives are HTML attributes with an ng prefix.
The ng-init directive initializes AngularJS application variables.
<!DOCTYPE html> <html>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.0/angular.m
in.js"></script>
<body>
<div ng-app="" ng-init="firstName='John'">
<p>The name is <span ng-bind="firstName"></span></p>
</div></body></html>
AngularJS Arrays
<div ng-app="" ng-init="points=[1,15,19,2,40]">
<p>The third result is {{ points[2] }}</p></div>
Angular JS Objects
<div ng-app=""
ng-init="person={firstName:‘R',lastName:‘Vijayan'}">
<p>The name is {{ person.lastName }}</p></div>
<script>
var app = angular.module("myApp", []);
</script>
The "myApp" parameter refers to an HTML element in which the application
will run.
Now you can add controllers, directives, filters, and more, to your AngularJS
application.
$scope.helloTo.title = "AngularJS";
});</script></body></html>
40 R.Vijayani / Asso Prof / SITE / VIT
Include AngularJS
included the AngularJS JavaScript file in the HTML page so we can use
AngularJS
Point to AngularJS app
tell what part of the HTML contains the AngularJS app either add it
to html element or body element
View
ng-controller tells AngularJS what controller to use with this
view. helloTo.title tells AngularJS to write the "model" value named
helloTo.title to the HTML at this location.
Controller
code registers a controller function named HelloController in the angular
module named myapp.
The $scope parameter passed to the controller function is the model. The
controller function adds a helloTo JavaScript object, and in that object it
adds a title field.
41 R.Vijayani / Asso Prof / SITE / VIT
When the page is loaded in the browser,
following things happen:
HTML document is loaded into the browser, and evaluated by the
browser.
AngularJS JavaScript file is loaded, the angular global object is created.
Next, JavaScript which registers controller functions is executed.
Next AngularJS scans through the HTML to look for AngularJS apps
and views.
Once view is located, it connects that view to the corresponding
controller function.
Next, AngularJS executes the controller functions.
It then renders the views with data from the model populated by the
controller.The page is now ready.
42 R.Vijayani / Asso Prof / SITE / VIT