I have a string in golang as follows.
discount = "("+discount+"% off)"
when passed to html via angularjs it is displayed as follows (10 %o(MISSING)ff)
Any idea why it is happening? Thanks in advance.
I have a string in golang as follows.
discount = "("+discount+"% off)"
when passed to html via angularjs it is displayed as follows (10 %o(MISSING)ff)
Any idea why it is happening? Thanks in advance.
Something in your HTML rendering process is passing the string through go's fmt.Sprintf
or similar. Try escaping the % by doubling it:
discount = "("+discount+"%% off)"
See http://play.golang.org/p/S_GEJXSfnD for a live example.