I would like to render Json
to angularJs
in my view, so in a file events.scala.html
I have this :
@(events: play.api.libs.json.JsValue)
@events
And it works fine, my Json
data is displayed on my page.
But I would like to transmit this Json
to angularJs, I would like to do something like this :
@(events: play.api.libs.json.JsValue)
@main(title = "title") {
<script>
app.controller ('TestCtrl', function ($scope){
$scope.events = </script> @events <script>
});
</script>
<div data-ng-controller="TestCtrl" data-ng-repeat="event in events">{{event.name}}</div>
}
How should I proceed?