Angular JS Module for Drupal

Events happening in the community are now at Drupal community events on www.drupal.org.
tyler.frankenstein's picture

I've created an Angular JS module for Drupal 7. It has full C.R.U.D. support for Drupal's core entity types, session authentication (login, logout, registration) and entity indexing. It automatically handles the X-CSRF-Token needs, and is built on top of the Services module.

The source code is available on GitHub:

https://github.com/easystreet3/angular-drupal

It's also available via npm:

npm install angular-drupal

The plan is start an 8.x branch of this module when D8 RC1 is available. Enjoy!

Comments

tyler.frankenstein's picture

I wrote a follow up blog post which utilizes the angular-drupal module: http://tylerfrankenstein.com/code/headless-drupal-angular-js-bootstrap

Drupal services + oauth + angularjs

adolfo.mansilla's picture

Hy Tyler, Have you used Oauth + Angular with drupal services? How I can do to use it?

Nope...

tyler.frankenstein's picture

I haven't used OAuth and Services at all yet, so I'd also be curious to see any available resources.

nasirm's picture

Satellizer AngularJS module provides OAuth 2.0 functionality to login using FB/Google+/linkedIn/Twitter/github/MSN Live

for details, pls visit https://github.com/sahat/satellizer

Thanks
Nasir Mallik

Lost Session

adolfo.mansilla's picture

Tyler I am trying to use your module. I login ok to the drupal site, but when makes auto call to system/connect, the session id change and the user is anonymous again.
Is there a server side configuration to make it work? Am I doing anything wrong?
I add the following lines to the .htaccess file:

Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, PUT, POST, OPTIONS"
Header set Access-Control-Allow-Credentials "true"
Header set Access-Control-Allow-Headers "Authorization, Origin, Content-Type, X-CSRF-Token"

Session authentication

tyler.frankenstein's picture

Make sure the "Session authentication" checkbox is checked on your service endpoint:

admin/structure/services/list/[my-endpoint]

I've never had to modify an .htaccess file to get it to work. But depending on the CORS policy of your hosting environment, there can definitely be issues.

system/connect error

adolfo.mansilla's picture

The session authentication is enabled correctly. The login method works fine (I made a console log and the user data is ok). The problem is on the system/connect after login.

New Version Released

tyler.frankenstein's picture

I've added some updates to the module, please try the new version. If that still doesn't work, please open an issue on GitHub and we'll get it figured out.

Headless Drupal

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: