Display Message using controller in AngularJS

This article explain you to display the message using controller in AngularJS.
Below Code is used to display message using AngularJS directive.
To implement this we need to write the code like as shown below

Java Script :-
var myApp = angular.module("myApp", []);

// Creating the controller and registering with the module all done in one line.
myApp.controller("myController2", function ($scope) {
    $scope.message = "Welcome AngularJS Tutorial";

<!DOCTYPE html>
<html ng-app="myApp">
    <title>Angular modules and controllers</title>
    <script src="../Scripts/angular.js"></script>
    <script src="../Scripts/Script.js"></script>
<body ng-controller="myController2">
   <div style="width:50%;margin:auto;"><b>{{message}}</b></div> 


Blogger Tips and TricksLatest Tips And TricksBlogger Tricks