javascript - How to pass variables to an Ember app? -


i'm trying connect ember app rest api generated wordpress. api requires nonce value passed along in header request prevent csrf attacks. nonce value provided in global javascript variable before app loaded. (the process described in rest api documentation) works fine default rest api client shipped wordpress plugin, example (written backbone).

i'm loading ember php template , using wordpress function generate root api url , nonce. javascript object looks this:

var wpapisettings = {"root":"http:\/\/apisite.dev\/wp-json\/","versionstring":"wp\/v2\/","nonce":"3d00cd1c5c"}; 

the question is, how nonce ember can make authenticated api request?


Comments