Hey Fab,
some random notes on what I did in some projects…
On 14 Jan 2015, at 16:59, FFFFFFFab wrote:
> I'm learning Angular and I would test it with Kotti as backend but I
> don't
> know how to deal with it, what is the best approach to explore to make
> the
> two interact. The test I would make is a single page web app that
> allows to
> browse through resources tree
I've yet to find a truly generic way for tree browsing / traversal.
This is on my todo list for 2015 and Kotti 1.x. What I did recently is
adding a view which returns a JSON serializable representation of
``context.children_with_permission`` like this:
@view_config(context=Content, name='children',
xhr=True, renderer='json', request_method='GET')
> and make CRUD operation without page reload.
CRUD is easy – see below.
> Actually, I don't know how to start : how to serve the frontend, with
> Kotti or independantly ?
I serve it with Kotti, but manage / build static resources in my
application with Bower and Gulp (actually 2: 1 for each JS and CSS).
> Can I override Document views by "REST views", or it's preferable to
> make a custom content type ?
I do neither. I use Restangular and configure it with
RestangularProvider.setBaseUrl(kotti_context_url)
RestangularProvider.setDefaultHeaders({"X-Requested-With":
'XMLHttpRequest'})
This can also be done with "pure" Angular (either with the $resource or
$http), I currently don't remember how though.
This way you can have separate Angular applications for different
content types and just add some views to Kotti decorated with
``@view_config(xhr=True, renderer='json',
request_method='GET|POST|PUT|DELETE')``
HTH,
Andreas