Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to refactor this Angular code to fix the $resource:badcfg error #29

Open
ldco2016 opened this issue Oct 30, 2017 · 0 comments
Open

Comments

@ldco2016
Copy link

Hi Roy,

I have been following your SPA with Angular and WordPress and I hit a wall when I get to adding custom data to the API response and displaying it. When I add register_api_field() to function register_new_field() I get this error:

Error: [$resource:badcfg]

This error is saying that $resource expects an array, but its getting an object. I do have Posts.query() in the first wpApp.controller(), but when I change Posts.query() to Posts.get() that did not change anything and Posts.query() is what you have in the tutorial.

I have the code I am working with here in my repo:
https://github.com/ldco2016/angular-spa

How do I write this to eliminate this bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant