I am a newbie in angularjs; the scope value are not displaying in the views.
I have two apps: myApp and ram - each one having their controllers.
I'm trying to display scope values. Only myApp shows values but ram does not.
<div ng-app="myApp" ng-controller="myCtrl">
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{firstName + " " + lastName}}
</div>
<div ng-app="ram" ng-controller="myCtrl2">
First Name: <input type="text" ng-model="firstName2"><br>
Last Name: <input type="text" ng-model="lastName2"><br>
<br>
Full Name: {{firstName2 + " " + lastName2}}
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.firstName= "John";
$scope.lastName= "Doe";
});
</script>
<script>
var app2 = angular.module('ram', []);
app2.controller('myCtrl2', function($scope) {
$scope.firstName2= "ram";
$scope.lastName2= "babu";
});
</script>