DemoController.js

angular.module('homepage').
controller('DemoController', function ($scope, AddTemplates, DataStoreSrvc, Server, TimelineService) {
	var timelineData = DataStoreSrvc.getPosts();
	var sidebarData = DataStoreSrvc.getSidebarData();
	var widgetsData = DataStoreSrvc.getWidgetsData();

	var data = {
		timeline: timelineData,
		sidebar: sidebarData,
		widgets: widgetsData
	};

	DataStoreSrvc.resetAll();

	$scope.data = data;

	function getDemoData() {
		TimelineService.setLoadingStatus(true);

		Server.getDemoData()
			.success(function (result) {
				console.log(result);
				AddTemplates.addData(result.data.templates);
				TimelineService.setLoadingStatus(false);
			});
	}

	getDemoData();
});