app.ng.directive('asterPlot', [function () {
	return {
		restrict: 'A',
		transclude: true,
		templateUrl: "/Scripts/Templates/Chart/AsterPlot.html",
		scope: {
			url: "=?",
			heading: "=",
			chartData: "=?",
			chartName: "=?",
			selectedId: "=?",
			groups: "=?",
			totals: "=?",
			interval: "=?",
			staticKey: "=?",
			highlightStageId: "=?",
		},
		controller: "App.Controller.AsterPlot"
	};
}])
app.ng.directive('barChart', [function () {
	return {
		restrict: 'A',
		transclude: true,
		templateUrl: app.root +  "/Scripts/Templates/Chart/BarChart.html",
		scope: {
		    chartData: "=?",
		    url: "=?"
		},
		controller: "App.Controller.BarChart"
	};
}])
app.ng.directive('dateView', [function () {
    return {
        restrict: 'A',
        transclude: true,
        templateUrl: "/Scripts/Templates/Controls/DateView.html",
        scope: {
        	date: "=",
        	datestyle: "=?",
			hideRaw: "=?"
        },
        controller: "App.Controller.DateView"
    };
}])
app.ng.directive('documentList', [function () {
    return {
        restrict: 'A',
        transclude: true,
        templateUrl: "/Scripts/Templates/Controls/DocumentList.html",
        scope: {
        	entity: "=",
        	entityType: "=",
        	entityGuid: "=",
        	mode: "=",
			readOnly: "="
        },
        controller: "App.Controller.DocumentList"
    };
}])
app.ng.directive("fileUploader", [function () {
	return {
		transclude: true,
		replace: true,
		templateUrl: "/Scripts/Templates/Controls/FileUpload.html",
		scope: {
			onFileSelected: "&"
		},
		controller: "App.Controller.FileUpload"
	};
}])
app.ng.directive('gauge', [function () {
	return {
		restrict: 'A',
		transclude: true,
		templateUrl: "/Scripts/Templates/Chart/Gauge.html",
		scope: {
			url: "=?",
			heading: "=",
			chartValue: "=?"
		},
		controller: "App.Controller.Gauge"
	};
}])
app.ng.directive('guidanceEditor', [function () {
	return {
		restrict: 'A',
		transclude: true,
		templateUrl: "/Scripts/Templates/Controls/GuidanceEditor.html",
		scope: {
		    indicatorId: "=",
		    readOnly: "="
		},
		controller: "App.Controller.GuidanceEditor"
	};
}])
app.ng.directive('indicatorOverview', [function () {
	return {
		restrict: 'A',
		transclude: true,
		templateUrl: "/Scripts/Templates/Indicator/IndicatorOverview.html",
		scope: {
		    indicatorId: "=",
            assessmentId: "=",
            sectorId: "="
		},
		controller: "App.Controller.IndicatorOverview"
	};
}])
app.ng.directive('lineChart', [function () {
	return {
		restrict: 'A',
		transclude: true,
		templateUrl: app.root +  "/Scripts/Templates/Chart/LineChart.html",
		scope: {
		    chartData: "=",
		    url: "=?"
		},
		controller: "App.Controller.LineChart"
	};
}])
app.ng.directive('liquidGauge', [function () {
	return {
		restrict: 'A',
		transclude: true,
		templateUrl: "/Scripts/Templates/Chart/LiquidGauge.html",
		scope: {
			url: "=?",
			heading: "=",
			chartValue: "=?"
		},
		controller: "App.Controller.LiquidGauge"
	};
}])
app.ng.directive('loader', [function () {
    return {
        restrict: 'A',
        transclude: true,
        template: "<div class='loader' ng-show='loading'></div>",
        scope: {
            
        },
        controller: ["$scope", function ($scope) {
            $scope.$on('loaderStart', function (args) {
                $scope.loading = true;
            });
            $scope.$on('loaderEnd', function (args) {
	            $scope.$evalAsync(function() {
	            	$scope.loading = false;
	            });
            });
        }]
    };
}])
app.ng.directive('miniAsterPlot', [function () {
	return {
		restrict: 'A',
		transclude: true,
		templateUrl: "/Scripts/Templates/Chart/MiniAsterPlot.html",
		scope: {
			url: "=?",
			heading: "=",
			chartData: "=?",
			chartName: "=?",
			selectedId: "=?",
			groups: "=?",
			totals: "=?",
			interval: "=?",
			staticKey: "=?",
			highlightStageId: "=?",
		},
		controller: "App.Controller.MiniAsterPlot"
	};
}])
app.ng.directive('pagerInfo', [function () {
    return {
        restrict: 'A',
        transclude: true,
        templateUrl: "/Scripts/Templates/Controls/PagerInfo.html",
        scope: {
        	currentPage: "=",
        	pageSize: "=",
        	resultsLength: "=",
			totalItems: "="
        }
    };
}])
app.ng.directive('pageSizer', [function () {
    return {
        restrict: 'A',
        transclude: true,
        templateUrl: "/Scripts/Templates/Controls/PageSizer.html",
        scope: {
            onPageSizeChanged: "&"
        },
        controller: "App.Controller.PageSizer"
    };
}])
app.ng.directive('pieChart', [function () {
	return {
		restrict: 'A',
		transclude: true,
		templateUrl: "/Scripts/Templates/Chart/PieChart.html",
		scope: {
			chartData: "=?",
			legendPosition: "=?",
		    url: "=?"
		},
		controller: "App.Controller.PieChart"
	};
}])
app.ng.directive('radarChart', [function () {
	return {
		restrict: 'A',
		transclude: true,
		templateUrl: "/Scripts/Templates/Chart/RadarChart.html",
		scope: {
			url: "=?",
			heading: "=",
            chartData: "=?",
			totals: "=?",
			interval: "=?",
            staticKey: "=?"
		},
		controller: "App.Controller.RadarChart"
	};
}])
