'use strict';

var DashboardMainController = angular.module('dashboard.controllers.main', [
    'system', 'ui.bootstrap', 'plunker'
])
    .controller('DashboardMainController', [
        '$scope',
        '$route',
        '$location',
        '$window',
        'System',
        'ArticleService',
        'NewslettersService',
        'ImageService',   
        function ($scope, $route, $location, $window ,System, ArticleService, NewslettersService, ImageService, PageService, PageFactory, ContentService, OdjeljenjeService) {
            $scope.query = {},
            System.Page.title("Dobro došli - Nenad Ješić");
            $scope.query = {},
            $scope.refresh = function () {
                ArticleService.queryfour($scope.query).then(function (data) {
                    $scope.articles = data.articles;
                });
            };

            $scope.fo = function () {
                $window.open('//facebook.com/profile.php?id=100007286538022');
            };

            $scope.selectLibrary = function (tip) {
                if (tip != null)
                    $location.url('/documentst/' + tip);
                else
                    $location.url('/documentst');
            };

          

            $scope.selectRadnik = function (radnikid) {
                $scope.refresh();
                $location.url('/radnik/' + radnikid);
            };

         

        }
    ]);