I have been programming with JSP and Angular JS. Currently, I am faced with a scenario where I need to work with a JSP page containing a hidden input field. To set the value of this input field, I am using a session attribute like so:
String policy = (String)session.getAttribute("POLICY_CHANGE");
<input type="hidden" value="<%=policy%>" name="policy" ng-model="$scope.policyChange" />
My main challenge is how to bind the value of this input field to a variable $scope.policy within my controller.
JS
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.policyChange= ; // My goal is to assign the input field's value here.
});