Skip to content

traverson/traverson-traversal

Repository files navigation

Published on webcomponents.org

<traverson-traversal>

This web component makes it easy to traverse RESTful APIs.

It is based on the amazing Traverson library.

Install

Install the component using Bower:

$ bower install traverson-traversal --save

Usage

Import Web Components polyfill:

<script src="/bower_components/webcomponentsjs/webcomponents-lite.js"></script>

Import Traverson Traversal Element:

<link rel="import" href="/bower_components/traverson-traversal/traverson-traversal.html"> 

Use it!:

<traverson-traversal
    auto
    from="http://example.org/api"
    follow="['link_to', 'resource']"
    last-response="{{document}}">
</traverson-traversal>

<p>{{document}}</p>