Saturday 12 September 2015

Angular JS Manual Bootstrap Example (Multiple Modules)

<!DOCTYPE html >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Angular JS Manual Bootstrap Example (Multiple Modules)</title>
<script src="lib/angular.js"></script>
<script>
// JavaScript Document
//module1
var app1 = angular.module("myapp1", []);
app1.contoller ("MssgController1", function ($scope) {
    $scope.message = "Angular Auto Bootstrap Mssg1";
}) ;
//module2
var app2 = angular.module("myapp2", [])
app2.controller ("MssgController2", function($scope) {
    $scope.message = "Angular Auto Bootstrap Mssg2";
})
//initiate manual process
angular.element(docuent).ready(function() {
var mssgdiv1 = document.getElementById('mssgdiv1');   

//bootstrap mssgdiv1 for module1 and module2
angular.bootstrap(mssgdiv1, ['myapp1', 'myapp2']);


});


</script>
</head>

<body>
<!--ANGULAR JS MANUAL BOOTSTRAP PROCESS-->
<div id="mssgdiv1">
  <h1>Angular JS Manual bootstrap example with Multiple modules </h1>
  <div ng-controller="MssgController1"> {{message}} </div>
  <div ng-controller="MssgController2"> {{message}} </div>
</div>
</body>
</html>

5 comments:

  1. Thank you for sharing like this information. This is the most easy way of learning. This helps me to get some idea regarding this and helps me to bring a creative thought.
    Dot Net training in Chennai

    ReplyDelete
  2. I simply want to say I’m very new to blogs and actually loved you’re blog site. Almost certainly I’m going to bookmark your blog post . You absolutely come with great well written articles. Thanks a lot for sharing your blog.

    Linux Training in Chennai Guindy

    ReplyDelete
  3. This blog is having the general information. Got a creative work and this is very different one.We have to develop our creativity mind.This blog helps for this. Thank you for this blog. This is very interesting and useful.

    ccna training in chennai saidapet

    ReplyDelete