Skip to content

Latest commit

 

History

History
executable file
·
60 lines (51 loc) · 1.9 KB

README.md

File metadata and controls

executable file
·
60 lines (51 loc) · 1.9 KB

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]