I am sending a request from below jsp
This is my Controller Code. We have update the working div using a diff jsp so I have used innerhtml to populate the result jsp into the working div . Please correct me if am wrong in doing this (using innerhtml) with Angular JS
app.controller('MyController', function($scope,WidgetData)
{
WidgetData.get({
id : '0'
}).then(function(response){
document.getElementById('workingDiv').innerHTML=response.data;
});
});
app.factory('WidgetData', function($http){
return {
get : function(params){
return $http.get('getMainMenu.do', {
params : params
});
}
};
});
Java Spring Controller
mav.setViewName("mainmenu");
ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
String json = ow.writeValueAsString(response);
mav.addObject("details", json);
This is the result JSP
{{detail}}
I have to Assign the JSON Data from the ModelAndView to the scope, which am trying to do in the ng-init as above . .
{{details}}
I did a check to see if am getting the JSON data and it is having the correct data. But am getting the output as shown above. Its only printing the text.Please correct me