Giter Site home page Giter Site logo

oblique's Introduction

Oblique

A set of components I've put together for working with AngularJS.

Directives

sortable

Creates a element indended to be a header for a ajaxy sortable list of some kind.

When the element is clicked on, it will call a callback function with a number of arguments and display a loading indicator.

Use: attribute-only

Arguments: The name of an in-scope callback function to be called on-click. The callback function should retrieve any data to be sorted and populate the DOM accordingly.

function (sort, invert, on_success) {...}

sort is the name of the field to be sorted. invert is whether or not the sorting should be inverted. on_success is a callback that should be called when the data request and DOM manipulation is complete.

Additional Required Attributes: sortable expects there to be a number of additional attributes on the element.

  • sortBy
    • The name of this field for sorting purposes. Maps to sort in the callback
  • invert
    • true or false. Whether the 'initial' sort state should be inverted or not`
  • icon
    • The url of the icon to be displayed when loading.

Example:

<table cellspacing="0">
    <thead>
        <tr>
            <th sortable="sort" sortBy='h2' invert='false'
                icon='static/loader.gif'>Heading2</th>
            <th sortable="sort" sortBy='h2' invert='true' 
                icon='static/loader.gif'>Heading2</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Text</td>
            <td>text2</td>
        </tr>
    </tbody>
</table>

Filters

truncate

Truncates a string to a certain number of characters. Optionally only truncates the string if it is longer than a certain threshold.

Prototype: truncate(limit, threshold)

Example: The following example will truncate text to 10 characters long if it is longer than 12 characters.

<span>{{text | truncate:10:12 }} </span>

oblique's People

Contributors

cwacek avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.