Within my AngularJS application, I am faced with the challenge of utilizing a value from an input/dropdown field in the second controller when a change event occurs. The structure of my code is as follows:
Code snippet (HTML) ::
<body ng-app="myApp" ng-controller="DropdownCtrl">
<input type="text" class="form-control" ng-model="dt" ng-change="changeDate(dt)" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="open($event)">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
<div class="row" ng-controller="MainCtrl">
<!-- other code -->
</div>
</body>
My objective is to access the value from the changeDate(dt) function in the MainCtrl when a change event occurs.