angularjs - to give multiple values to thymeleaf attribute -


i have requirement give multiple values thymeleaf attribute. in view page, combination of angular, thymleaf spring mvc.

<div id="ziplookup" ng-controller="addressmanagementctrl" data-th-attr="data-data=*{primary.zipcode}, *{primary.county}, *{primary.city}, *{primary.street1}, *{primary.street2}"> 

which throwing error

templateprocessingexception: not parse assignation sequence. "data-data=*{primary.postcode},*{primary.county},*{primary.city},*{primary.street1},*{primary.street2}"

it clear syntax incorrect, can 1 suggest me correct way implement this. intention after document parse, should this:

data-data='{   "zipcode": "90292",   "state": "ca",   "county": "--",   "city": "marina",   "addressline1": "...",   "addressline2": "..." }' 

here zipcode, state,county,city,addressline1,addressline2 properties of spring bean.

i'm kind of new thymeleaf , angular-js. can help? there way implement this?

the following work:

data-th-attr="data-data= + *{primary.zipcode} + ',' + *{primary.county}" 

the output html be:

data-th-attr="data-data=somezip,somecountry" 

i suggest consider possibility of preparing string in controller (possibly using json library jackson) , passing model (which use directly).


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -