0
私はJSPとAngular JSで作業しています。私は隠された入力フィールドを持つJSPページを持っています。セッション属性は次のようにその値に設定されます。コントローラの入力値のバインド値 - AngularJS
String policy = (String)session.getAttribute("POLICY_CHANGE");
<input type="hidden" value="<%=policy%>" name="policy" ng-model="$scope.policyChange" />
は、どのように私は私のコントローラ内の変数$ scope.policyに入力フィールドの値をバインドすることができます。
JSあなたのinput
ため
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.policyChange= ; // i want to bind the input field value here.
});
Shareer、それは動作していますか? –
[あなたの質問と私の答え](http://stackoverflow.com/questions/42300219/accessing-jsp-variable-from-javascript-angular-js/42302283#42302283)は機能しませんか? –