javascript - How to assign a php json variable to angular without a rest call? -


i want load initial page php, instead of making rest call variable, have variable in page , need way assign angular. saw different ways doing like

<.....ng-init="somefunction('<?echo $myjsonstring?>')">  

but not working thinks json string ends @ first double codes .i though replace double codes special symbol , in angular replace require processing think reduce performance. there other way this?

try json_encode:

<...ng-init="somefunction('<?php echo json_encode($myjsonstring); ?>')"> 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

python - Exception while importing pymorphy2 -

c# - Nested Internal Class with Readonly Hashtable throws Null ref exception.. on assignment -