Closed MurhafSousli closed 8 years ago
I could be wrong (@adamsilverstein is the authority here), but I believe that this script is designed to be enqueued through WordPress, so that WP's script localization capabilities can inject that configuration object based on your specific WP install. Is there a reason you need to hard-code a script tag for the client JS rather than using the enqueue script method?
I believe that this script is designed to be enqueued through WordPress
In fact, it's required to be, you can't use it outside of WP.
I'm using wp rest api to get data for an angular2 app client, which is outside WP
You need to use an alternative library and authentication method to access the API outside WP.
@MurhafSousli This library is indeed currently designed to be enqueued from WordPress, however your question brings up an interesting point: can we remove the WordPress dependency?
Hi, I tried to include the script
wp-api.min.js
from the build dir, I get this exceptionUncaught ReferenceError: wpApiSettings is not defined(anonymous function) @ models.js:114
how can I fix this error?