angularjs - Javascript: how to include a string literal into another one? -


say we've got tag follows:

<div ng-init="html='<a ng-click=\'openpopover(\'#choixdeladensiterecherche\')\'>click</a>'"></div> 

(i need set variables html code)

this doesn't work. how write escaping innermost simple quotes?

ps: don't know why \" \" didn't worked either.

[edit 1] lecture error: [error] error: [$parse:lexerr] lexer error: unexpected next character @ columns 12-12 [] in expression [openpopover(].

try &quot;, example:

<div onclick="alert('<a ng-click=&quot;openpopover(\'#choixdeladensiterecherche\')&quot;>click</a>')">aaaaa</div> 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -