node.js - Passing variable from jade to ng-init not working -


i'm trying pass object jade ng-init in angular

this: doesn't work:

ng-init='tables=!{json.stringify(tables)}' 

this: expands but,

ng-init='tables=#{json.stringify(tables)}' 

the output unescaped , filled "s

ng-init="tables={"12":{"id":.... 

and view isn't updated in either of cases. this article implies first 1 should work, said, doesn't expand,

ng-init='tables=!{json.stringify(tables)}' 

in source code shows same in html source

ng-init='tables=!{json.stringify(tables)}' 

actually, #{...} approach seems work fine.
way console.log prints attributes' values confused you.

ng-init="tables=#{json.stringify(tables)}" 

take @ short demo.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -