alternatex / x-aspect

A X-Tag element for AOP with before, around, on, afterReturning, afterThrowing, after advice, and pointcuts

Home Page:http://alternatex.github.io/x-aspect/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

<x-aspect>

A X-Tag element for AOP with before, around, on, afterReturning, afterThrowing, after advice, and pointcuts.

Maintained by Gianni Furger.

Wrapping meld by CujoJS team.

Use Cases

  • Logging
  • Profiling
  • Security
  • Transactions

Demo

Check it live.

Install

Install with Bower:

$ bower install --save x-tag-aspect

Usage

  1. Import Web Components' polyfill:

    <script src="dist/x-tags-components.js"></script>
  2. Import meld:

    <script src="app/bower_components/meld/meld.js"></script>
  3. Import Custom Element:

    <script src="dist/aspect.js"></script>
  4. Start using it!

    <x-aspect origin="" source="console" function="log" advice="" condition="" trigger=""/>

Examples

HTML

<!-- Intercept console.log  -->
<x-aspect origin="" source="console" function="log" advice="" condition="" trigger=""/>

Setup

In order to run it locally you'll need a basic server setup.

  1. Install Node.js

  2. Install Grunt:

    $ npm install --global grunt-cli
  3. Install Bower

  4. Install local dependencies:

    $ npm install && bower install
  5. Run a local server and open http://localhost:3001.

    $ grunt connect

Options

Attribute Options Default Description
origin object `` -
source *object function* ``
function function `` -
advice string `` -
condition boolean `` -
trigger event `` -

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

History

For detailed changelog, check Releases.

License

MIT License

About

A X-Tag element for AOP with before, around, on, afterReturning, afterThrowing, after advice, and pointcuts

http://alternatex.github.io/x-aspect/

License:MIT License


Languages

Language:JavaScript 96.9%Language:CSS 3.1%