title: AngularJs how to access Model Attribute value from Spring MVC controller
body: <p>I have a Spring MVC Controller returning a page with an attribute as followed</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.GET, value = "/create")
  public ModelAndView getAddAccountView() {
      ModelAndView model = new ModelAndView("protected/accounts/AccountAddView");
      List&lt;Client&gt; clients=clientService.findAll();
      model.addObject("listClients", clients);
      return model;
  }
  </code></pre>
  
  <p>Client is a @Entity </p>
  
  <p>in my AccountAddView.jsp file, i'm trying to use the ng-init as follow:</p>
  
  <pre><code>&lt;div class="row-fluid" ng-controller="accountsController as ctrl" ng-init="clients=${listClients}"&gt;
  </code></pre>
  
  <p>and in my app.js, in my controller, i try to access the list of client as followed</p>
  
  <pre><code>var listOfClients=$scope.clients;
  </code></pre>
  
  <p>but I'm still getting the following error</p>
  
  <pre><code>angular.min-1.5.3.js:116 Error: [$parse:lexerr] http://errors.angularjs.org/1.5.3/$parse/lexerr?p0=Unexpected%20nextharacter%20&amp;p1=s%2033-33%20%5B%40%5D&amp;p2=clients%3D%5Bsoftbank.ui.model.Client%4042%2C%softbank.ui.model.Client%4041%2C%softbank.ui.model.Client%4043%5D
  at Error (native)
  at http://localhost:8080/softbank/resources/js/angular.min-1.5.3.js:6:416
  at gc.throwError (http://localhost:8080/softbank/resources/js/angular.min-1.5.3.js:212:149)
  at gc.lex (http://localhost:8080/softbank/resources/js/angular.min-1.5.3.js:211:16)
  at Object.ast (http://localhost:8080/softbank/resources/js/angular.min-1.5.3.js:216:103)
  at Object.compile (http://localhost:8080/softbank/resources/js/angular.min-1.5.3.js:225:232)
  at hc.parse (http://localhost:8080/softbank/resources/js/angular.min-1.5.3.js:252:380)
  at e (http://localhost:8080/softbank/resources/js/angular.min-1.5.3.js:123:317)
  at m.$eval (http://localhost:8080/softbank/resources/js/angular.min-1.5.3.js:142:463)
  at pre (http://localhost:8080/softbank/resources/js/angular.min-1.5.3.js:271:500)
  </code></pre>
  
  <p>please what is wrong here. why is ng-init generating this errors? 
  thanks in advance for your answer.</p>