jeffsebring / angular-wp-api

An AngularJS Client for WP-API
124 stars 15 forks source link

$injector is unable to resolve a required dependency : wpAPIDataProvider #5

Closed joao-parana closed 10 years ago

joao-parana commented 10 years ago

I don't know how to resolve this issue.

wpAPIResource is injected successfully but wpAPIData not !

My controller:

  // Wordpress Resource Support
  app.controller('WPRemoteFetchCtrl',
    function ($scope, wpAPIResource, wpAPIData) {
      $scope.wordpress = {};
      $scope.wordpress.root = wpAPIResource.get();
      $scope.wordpress.post1 = wpAPIResource.get( {
          param1: 'posts',
          param2: 1
      });
      $scope.wordpress.user = wpAPIResource.get( {
          param1: 'users',
          param2: wpAPIData.user_id
      });
  });

Any Ideas ?

jeffsebring commented 10 years ago

@joao-parana This is most likely due to the script dependencies not being met.

Please have a second look at the Inclusion section of the Read Me. It is probably either WP-API not being enabled, or the dependency set in your add_theme_support is not enqueued.

joao-parana commented 10 years ago

Tanks @jeffsebring. It's working now.

jeffsebring commented 10 years ago

I'm glad I could be of help.