/**
 * ProjectTasksCtrl Controller
 * Extracted from bookings module
 */

Bookings.controller('ProjectTasksCtrl', ['$scope', 'Project', 'ErrorsHandler', function ($scope, Project, ErrorsHandler) {

	$scope.project = null;

	$scope.$watch('projectId', function (value) {
		if (value) $scope.load();
	});

	$scope.load = function () {
		Project.get({ projectId: $scope.projectId }, function (response) {
			$scope.project = response;
		}, ErrorsHandler);
	};

}])
