0.1.3 • Published 9 years ago

angular-chute v0.1.3

Weekly downloads
12
License
-
Repository
github
Last release
9 years ago

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.

0.1.3

9 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.1

10 years ago