This project tries to reimplement the Bartik theme from Drupal 8 as an AngularJS webapplication communicating with Drupal through ReST
This project setup is done by angular-seed
All dependencies are managed with npm and bower. To start clone this repository and run:
$ npm install
$ npm start
...
^C
Drupal 8 ReST doesn't support CORS yet so the app directory should be
hosted on the same hostname and port as the Drupal 8 instance running
the ReST api. The easiest way is to copy or symlink the app
directory from
this repo to to root of your Drupal 8 installation.
BASIC AUTH is currently broken on authenticated users and views REST export so we use COOKIE based.
# Go to your Drupal 8 root directory
$ cd /var/www/drupal
$ ln -s /path/to/drupal-8-rest-angularjs/app .
You must copy config.js.dist
to app/config.js
and change it's values.
When having configured your web server of the .htaccess with core you should change the app.js config section.
Current version only supports hal+json so make sure all views and rest resources support these.
Install and enable Rest UI module. With that module you can expose nodes, comments and users to Rest clients.
Add a "Rest export" display to the following views:
- http://drupal.d8/admin/structure/views/view/frontpage set path to '/node'
- http://drupal.d8/admin/structure/views/view/taxonomy_term/ set path to '/taxonomy/term/%'
You need to import the views from /app/_drupal
directory.
This view adds a "Rest export" display with path to '/taxonomy/list' to display the term name.
This view adds a "Rest export" display with path to '/node/%/comments' to display the comments.
Check the configuration on http://drupal.d8/admin/config/services/rest
Check the permissions on http://drupal.d8/admin/people/permissions for 'RESTful Web Services' permissions.