Important Notice:

Course Content
Switch Statement
0/1
break and continue Statements
0/3
Basic Form Validation in JavaScript
0/1
JavaScript & Angular JS (Chapter- 6) M2-R5.1
About Lesson

Creating a Module:-

                Angular JS function angular.module का उपयोग करके एक मॉड्यूल बनाया जाता है।

Adding a controller:-

                              Add a controller to your application, and refer to the controller with the ng-controller directive.

Modules and Controller in files:-

      एंगुलर जेएस एप्लिकेशन में मॉड्यूल और controllers को जावास्क्रिप्ट फाइलों में रखना आम बात है।

<!DOCTYPE html>

<html>  

<head>     

<title>Angular Modules Example</title>     

<script src=”https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js”>     

</script>  

</head>  

<body>     

<div ng-app=”myApp” ng-controller=”myCtrl”>        

{{ firstName + ” ” + lastName }}     

</div>     

<script>        

var app = angular.module(“myApp”, []);

app.controller(“myCtrl”, function($scope)          

{           

 $scope.firstName = “Akhilesh”;           

$scope.lastName = “Sir”;        

});     

</script>  

</body>

</html>

 

 

Creating a Module:-

                              A module is created using the Angular JS function angular.module.

Adding a controller:-

                Add a controller to your application, and refer to the controller with the ng-controller directive.

Modules and Controller in files:-

It is common in Angular JS applications to place modules and controllers in JavaScript files.

<!DOCTYPE html>

<html>  

<head>     

<title>Angular Modules Example</title>     

<script src=”https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js”>     

</script>  

</head>  

<body>     

<div ng-app=”myApp” ng-controller=”myCtrl”>        

{{ firstName + ” ” + lastName }}     

</div>     

<script>        

var app = angular.module(“myApp”, []);

app.controller(“myCtrl”, function($scope)          

{           

 $scope.firstName = “Akhilesh”;           

$scope.lastName = “Sir”;        

});     

</script>  

</body>

</html>

error: Content is protected !!