Skip to content

acidstudios/angular-trello

Repository files navigation

angular-trello

Build Status Dependency Status Dev Dependency Status

Angular.JS module to handle the Trello Api.

Install

$ bower install angular-trello

Usage

var app = angular.module('providertest', ['trello']);

			//  Configure the Provider
        	app.config(['TrelloApiProvider', function(TrelloApiProvider) {
        		TrelloApiProvider.init({
        			key: 'YOUR_KEY',
        			secret: 'YOUR_SECRET',
        			scope: {read: true, write: true, account: true},
        			name: 'Angular-Trello Test'
        		});
        	}]);

        	// Use into the Controllers
        	app.controller('TestCtrl', ['$scope', 'TrelloApi', function($scope, TrelloApi){
        		$scope.boards = [];
        		$scope.test = function () {
        			TrelloApi.Authenticate().then(function(){
        				alert(TrelloApi.Token());
        			}, function(){
        				alert('no');
        			});
        		};

        		$scope.getMe = function () {
        			TrelloApi.Rest('GET', 'members/me').then(function(res){
        				$scope.boards = res.idBoards;
        				alert(res);
        			}, function(err){
        				alert(err);
        			});
        		};

        		$scope.getBoards = function() {
        			TrelloApi.boards($scope.boards[0], {}).then(function(res) {
        				alert(res);
        			}, function(err) {
        				alert(err);
        			});
        		};
        	}]);

Credits

Gustavo Barrientos Guerrero [email protected]

About

Angular Wrapper for Trello API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published