I am currently developing an application using AngularJS.
Within my application, I have implemented two controllers to manage two distinct views.
Below is the JavaScript code:
var myApp1 = angular.module('myApp1', []);
myApp1.controller('myController1', function($scope) {
alert("check");
$scope.x = 'test';
});
var myApp2 = angular.module('myApp2', []);
myApp2.controller('myController2', function($scope) {
alert("check1");
$scope.x = 'test';
});
Here is the HTML code:
<div ng-app="myApp1">
<div ng-controller="myController1">
<input type="text" ng-model="x" /> {{x}}
</div>
</div>
<div ng-app="myApp2">
<div ng-controller="myController2">
<input type="text" ng-model="x" /> {{x}}
</div>
</div>
However, I am facing an issue where only the first controller is being executed.
I would greatly appreciate any advice or suggestions on how to resolve this problem.