Ich arbeite mit JSP und Angular JS. Ich habe eine JSP-Seite mit einem versteckten Eingabefeld. Ein Sitzungsattribut wird wie folgt auf seinen Wert gesetzt.Bind-Wert eines Eingangs in Controller-AngularJS
String policy = (String)session.getAttribute("POLICY_CHANGE");
<input type="hidden" value="<%=policy%>" name="policy" ng-model="$scope.policyChange" />
Wie kann ich binden den Wert des Eingabefeldes auf eine Variable $ scope.policy in meinem Controller.
JS
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.policyChange= ; // i want to bind the input field value here.
});
Shareer, es funktioniert? –
[Ihre Frage und meine Antwort] (http://stackoverflow.com/questions/42300219/accessing-jsp-variable-from-javascript-angular-js/42302283#42302283) ist es nicht funktioniert? –