angular-chute

0.1.3 • Public • Published

angular-chute Build Status

Chute API wrapper for AngularJS.

Installation

Getting started

To display images from an album inside a gallery:

<div ng-app="myApp" class="gallery" ng-controller="GalleryCtrl">
  <div class="gallery-item" ng-repeat="asset in assets">
    <img ng-src="{{asset.url}}/w/300" alt="{{asset.caption}}" width="300">
 
    <div class="heart" ng-class="{'active': asset.hearted()}" ng-click="asset.toggleHeart()"></div>
    
    <p>{{asset.caption}}</p>
    
    <div ng-pluralize class="hearts" count="asset.hearts" when="{'one':'1 heart', 'other':'{} hearts'}"></div>
  </div>
</div>
angular.module('myApp').controller('GalleryCtrl', ['$scope', function($scope) {
  $scope.assets = Asset.query({album: 'shortcut'});
}]);

Now that you have a collection of assets, you can request next page as simply as:

$scope.assets.nextPage();

Thanks to Angular's data binding, the view will be updated automatically.

Documentation

Available as annotated source code.

Testing

npm test

License

MIT License. Copyright (c) 2013 Chute Corporation.

Readme

Keywords

none

Package Sidebar

Install

npm i angular-chute

Weekly Downloads

4

Version

0.1.3

License

none

Last publish

Collaborators

  • petrbela