Angular Js
Angular Js
Angular-js is open source java-script framework which use for make a moder web application
SPAs mean when we need the update in application and it perform in a one page that called SPAs
It is extend with html and it given a additional feature like two-way data binding
<script>
<src = “ https://ajax.googleaips.com/ajax/libs/angularjs/1.8.2/angular,min.js”>
</script>
Data binding
The angular-js give function is data binding which give a real time reflection of the input which given by
user
The synchronize the data between model and view connect automatically
1. Interpolation
2. Property binding
1 interpolation
interpolation mean when we give the variable in curly brackets and it is give the
response
class= “{{variable_name}}”
2 property binding
property binding is just like the java when we create a parent class and inherited a child
class
[class] = “variable_name”
Andular-js controller
The angular js controller is a significant role in a angular the angular-js controller,control the flow of data
in web application
Angular-js control is a java script object which is create by the javasciprt object constructor
Content
</element >
Example
<p>2+3={{addnumber(2,3)}} </p>
<script>
App.controller= (“mathcontroller”,function($scope){
$scope.addnumber = function(a,b){
Return a+b;
};
});
<script>
NG-app
NG-BIND
MVC ARCHITECTURE
MVC is the framework architecture which is the separated the application in to three layer
Controller
Controller is the interconnection between the view and model and the act like and intermediate
controller does not have to handle or mange the data
Controller is a incoming request it manipulate the model and interact with the view
View
View create the interface using data and it collect from the view not directly trough the controller
Controller
The angular js controller is a significant role in a angular the angular-js controller,control the flow of data
in web application
Angular-js control is a java script object which is create by the javasciprt object constructor
Example:
{{ "angularjs" | uppercase }} <!-- Output: ANGULARJS -->
Example:
Example:
Example:
Example:
Example:
Output:
Limits the number of items displayed in an array or the number of characters in a string.
Example:
<html>
<head>
<script src=
"https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js">
</script>
<script src=
"https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular-route.js">
</script>
</head>
<body ng-app="myApp">
<a href="#!courses">Courses</a>
<br>
<a href="#!internships">Internships</a>
<div ng-view></div>
<script>
app.config(function ($routeProvider) {
$routeProvider
.when("/courses", {
<p>
<ul>
<li>Geeks Classes</li>
<li>System Design</li>
</ul>
</p>`
})
.when("/internships", {
<p>
<ul>
<li>Software Developer</li>
</ul>
</p>`
});
});
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Padding Example</title>
<style>
body {
margin: 0;
padding: 20px;
width: 50%;
h2 {
color: green;
.myDiv {
background-color: lightblue;
padding-top: 80px;
padding-right: 100px;
padding-bottom: 50px;
padding-left: 80px;
.inner {
background-color: pink;
width: 70px;
height: 50px;
display: flex;
align-items: center;
justify-content: center;
</style>
</head>
<body>
<div class="myDiv">
<div class="inner">Pad_Box</div>
</div>
</body>
</html>