var page = "myschedule.html";
var myscheduleApp = angular.module('myscheduleApp', ['menuController', 'scheduleService', 'notetasksCtrl', 'appointmentsService',//
    'notetasksService', 'notetasktypesService', 'AppointmentsController', 'appointmentstatusesService','soundsService',//
    'customersService', 'callaheadsService', 'customertypesService', 'flexiblecustomersService', 'jobsitesService','chatsettingsService','userchatstatusesService',//
    'ordertypesService', 'ordersService', 'orderstatusesService', 'listviewusersService', 'flagsService', 'leadsourcesService', 'opportunitiesService', //
    'groupsService', 'customerfilesService', 'tasksService', 'checklistController', 'ivh.treeview', 'checklistsService', 'servicesService', 'appointmentchecklistsService',//
    'ngTagsInput','notifiesCtrl','chatApp'
]);
myscheduleApp.run(function ($ionicPlatform, $ionicLoading) {
    $ionicLoading.show({ template: templateLoading });
    $ionicPlatform.ready(function () {
        var devicePlatform = "";
        try {
            devicePlatform = device.platform;
        } catch (err) {
            console.log(err)
        }
        if (devicePlatform != "iPhone" && devicePlatform != "iOS") {
            // $scope.deviceLoading = "ios";
            isiOs = false;
        }
        //ionic.Platform.fullScreen();
        // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
        // for form inputs)
        if (window.cordova && window.cordova.plugins.Keyboard) {
            cordova.plugins.Keyboard.hideKeyboardAccessoryBar(false);
            cordova.plugins.Keyboard.disableScroll(true);
        }
        if (window.StatusBar) {
            // org.apache.cordova.statusbar required
            // StatusBar.styleDefault();
            StatusBar.show();
            StatusBar.backgroundColorByHexString("#327EBB");
            StatusBar.styleLightContent();
            //StatusBar.hide();
            StatusBar.overlaysWebView(false);
        }
    });
})

myscheduleApp.config(function ($stateProvider, $urlRouterProvider) {
    $stateProvider.state('dashboard', {
        url: '/board',
        abstract: true,
        templateUrl: 'templates/dashboard/general/menu.html',
        controller: 'menuCtrl'
    }).state('dashboard.myschedule', {
        url: '/myschedule',
        views: {
            'menuContent': {
                templateUrl: 'templates/dashboard/myschedules/myschedule.tpl',
                controller: 'myscheduleCtrl'
            }
        }
    })
    // if none of the above states are matched, use this as the fallback
    $urlRouterProvider.otherwise('/board/myschedule');
});
