Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"globalstrict": true,
"globals": {
"angular": false,
"console": false
}
}
283 changes: 138 additions & 145 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,151 +8,144 @@
* Main module of the application.
*/
angular
.module('sbAdminApp', [
'oc.lazyLoad',
'ui.router',
'ui.bootstrap',
'angular-loading-bar',
])
.config(['$stateProvider','$urlRouterProvider','$ocLazyLoadProvider',function ($stateProvider,$urlRouterProvider,$ocLazyLoadProvider) {

$ocLazyLoadProvider.config({
debug:false,
events:true,
});
.module('sbAdminApp', [
'oc.lazyLoad',
'ui.router',
'ui.bootstrap',
'angular-loading-bar',
])
.config(['$stateProvider', '$urlRouterProvider', '$ocLazyLoadProvider', function($stateProvider, $urlRouterProvider,
$ocLazyLoadProvider) {

$urlRouterProvider.otherwise('/dashboard/home');
$ocLazyLoadProvider.config({
debug: false,
events: true,
});

$stateProvider
.state('dashboard', {
url:'/dashboard',
templateUrl: 'views/dashboard/main.html',
resolve: {
loadMyDirectives:function($ocLazyLoad){
return $ocLazyLoad.load(
{
name:'sbAdminApp',
files:[
'scripts/directives/header/header.js',
'scripts/directives/header/header-notification/header-notification.js',
'scripts/directives/sidebar/sidebar.js',
'scripts/directives/sidebar/sidebar-search/sidebar-search.js'
]
}),
$ocLazyLoad.load(
{
name:'toggle-switch',
files:["bower_components/angular-toggle-switch/angular-toggle-switch.min.js",
"bower_components/angular-toggle-switch/angular-toggle-switch.css"
]
}),
$ocLazyLoad.load(
{
name:'ngAnimate',
files:['bower_components/angular-animate/angular-animate.js']
})
$ocLazyLoad.load(
{
name:'ngCookies',
files:['bower_components/angular-cookies/angular-cookies.js']
})
$ocLazyLoad.load(
{
name:'ngResource',
files:['bower_components/angular-resource/angular-resource.js']
})
$ocLazyLoad.load(
{
name:'ngSanitize',
files:['bower_components/angular-sanitize/angular-sanitize.js']
})
$ocLazyLoad.load(
{
name:'ngTouch',
files:['bower_components/angular-touch/angular-touch.js']
})
}
}
})
.state('dashboard.home',{
url:'/home',
controller: 'MainCtrl',
templateUrl:'views/dashboard/home.html',
resolve: {
loadMyFiles:function($ocLazyLoad) {
return $ocLazyLoad.load({
name:'sbAdminApp',
files:[
'scripts/controllers/main.js',
'scripts/directives/timeline/timeline.js',
'scripts/directives/notifications/notifications.js',
'scripts/directives/chat/chat.js',
'scripts/directives/dashboard/stats/stats.js'
]
})
}
}
})
.state('dashboard.form',{
templateUrl:'views/form.html',
url:'/form'
})
.state('dashboard.blank',{
templateUrl:'views/pages/blank.html',
url:'/blank'
})
.state('login',{
templateUrl:'views/pages/login.html',
url:'/login'
})
.state('dashboard.chart',{
templateUrl:'views/chart.html',
url:'/chart',
controller:'ChartCtrl',
resolve: {
loadMyFile:function($ocLazyLoad) {
return $ocLazyLoad.load({
name:'chart.js',
files:[
'bower_components/angular-chart.js/dist/angular-chart.min.js',
'bower_components/angular-chart.js/dist/angular-chart.css'
]
}),
$ocLazyLoad.load({
name:'sbAdminApp',
files:['scripts/controllers/chartContoller.js']
})
}
}
})
.state('dashboard.table',{
templateUrl:'views/table.html',
url:'/table'
})
.state('dashboard.panels-wells',{
templateUrl:'views/ui-elements/panels-wells.html',
url:'/panels-wells'
})
.state('dashboard.buttons',{
templateUrl:'views/ui-elements/buttons.html',
url:'/buttons'
})
.state('dashboard.notifications',{
templateUrl:'views/ui-elements/notifications.html',
url:'/notifications'
})
.state('dashboard.typography',{
templateUrl:'views/ui-elements/typography.html',
url:'/typography'
})
.state('dashboard.icons',{
templateUrl:'views/ui-elements/icons.html',
url:'/icons'
})
.state('dashboard.grid',{
templateUrl:'views/ui-elements/grid.html',
url:'/grid'
})
}]);
$urlRouterProvider.otherwise('/dashboard/home');


$stateProvider
.state('dashboard', {
url: '/dashboard',
templateUrl: 'views/dashboard/main.html',
resolve: {
loadMyDirectives: function($ocLazyLoad) {
return $ocLazyLoad.load({
name: 'sbAdminApp',
files: [
'scripts/directives/header/header.js',
'scripts/directives/header/header-notification/header-notification.js',
'scripts/directives/sidebar/sidebar.js',
'scripts/directives/sidebar/sidebar-search/sidebar-search.js'
]
}),
$ocLazyLoad.load({
name: 'toggle-switch',
files: [
"bower_components/angular-toggle-switch/angular-toggle-switch.min.js",
"bower_components/angular-toggle-switch/angular-toggle-switch.css"
]
}),
$ocLazyLoad.load({
name: 'ngAnimate',
files: ['bower_components/angular-animate/angular-animate.js']
}),
$ocLazyLoad.load({
name: 'ngCookies',
files: ['bower_components/angular-cookies/angular-cookies.js']
}),
$ocLazyLoad.load({
name: 'ngResource',
files: ['bower_components/angular-resource/angular-resource.js']
}),
$ocLazyLoad.load({
name: 'ngSanitize',
files: ['bower_components/angular-sanitize/angular-sanitize.js']
}),
$ocLazyLoad.load({
name: 'ngTouch',
files: ['bower_components/angular-touch/angular-touch.js']
});
}
}
})
.state('dashboard.home', {
url: '/home',
controller: 'MainCtrl',
templateUrl: 'views/dashboard/home.html',
resolve: {
loadMyFiles: function($ocLazyLoad) {
return $ocLazyLoad.load({
name: 'sbAdminApp',
files: [
'scripts/controllers/main.js',
'scripts/directives/timeline/timeline.js',
'scripts/directives/notifications/notifications.js',
'scripts/directives/chat/chat.js',
'scripts/directives/dashboard/stats/stats.js'
]
});
}
}
})
.state('dashboard.form', {
templateUrl: 'views/form.html',
url: '/form'
})
.state('dashboard.blank', {
templateUrl: 'views/pages/blank.html',
url: '/blank'
})
.state('login', {
templateUrl: 'views/pages/login.html',
url: '/login'
})
.state('dashboard.chart', {
templateUrl: 'views/chart.html',
url: '/chart',
controller: 'ChartCtrl',
resolve: {
loadMyFile: function($ocLazyLoad) {
return $ocLazyLoad.load({
name: 'chart.js',
files: [
'bower_components/angular-chart.js/dist/angular-chart.min.js',
'bower_components/angular-chart.js/dist/angular-chart.css'
]
}),
$ocLazyLoad.load({
name: 'sbAdminApp',
files: ['scripts/controllers/chartContoller.js']
});
}
}
})
.state('dashboard.table', {
templateUrl: 'views/table.html',
url: '/table'
})
.state('dashboard.panels-wells', {
templateUrl: 'views/ui-elements/panels-wells.html',
url: '/panels-wells'
})
.state('dashboard.buttons', {
templateUrl: 'views/ui-elements/buttons.html',
url: '/buttons'
})
.state('dashboard.notifications', {
templateUrl: 'views/ui-elements/notifications.html',
url: '/notifications'
})
.state('dashboard.typography', {
templateUrl: 'views/ui-elements/typography.html',
url: '/typography'
})
.state('dashboard.icons', {
templateUrl: 'views/ui-elements/icons.html',
url: '/icons'
})
.state('dashboard.grid', {
templateUrl: 'views/ui-elements/grid.html',
url: '/grid'
});
}]);
73 changes: 36 additions & 37 deletions app/scripts/controllers/chartContoller.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,63 +7,62 @@
* Controller of the sbAdminApp
*/
angular.module('sbAdminApp')
.controller('ChartCtrl', ['$scope', '$timeout', function ($scope, $timeout) {
.controller('ChartCtrl', ['$scope', '$timeout', function($scope, $timeout) {
$scope.line = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
series: ['Series A', 'Series B'],
data: [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
],
onClick: function (points, evt) {
console.log(points, evt);
}
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
series: ['Series A', 'Series B'],
data: [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
],
onClick: function(points, evt) {
console.log(points, evt);
}
};

$scope.bar = {
labels: ['2006', '2007', '2008', '2009', '2010', '2011', '2012'],
series: ['Series A', 'Series B'],
labels: ['2006', '2007', '2008', '2009', '2010', '2011', '2012'],
series: ['Series A', 'Series B'],

data: [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
]

data: [
[65, 59, 80, 81, 56, 55, 40],
[28, 48, 40, 19, 86, 27, 90]
]

};

$scope.donut = {
labels: ["Download Sales", "In-Store Sales", "Mail-Order Sales"],
data: [300, 500, 100]
labels: ["Download Sales", "In-Store Sales", "Mail-Order Sales"],
data: [300, 500, 100]
};

$scope.radar = {
labels:["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],
labels: ["Eating", "Drinking", "Sleeping", "Designing", "Coding", "Cycling", "Running"],

data:[
[65, 59, 90, 81, 56, 55, 40],
[28, 48, 40, 19, 96, 27, 100]
]
data: [
[65, 59, 90, 81, 56, 55, 40],
[28, 48, 40, 19, 96, 27, 100]
]
};

$scope.pie = {
labels : ["Download Sales", "In-Store Sales", "Mail-Order Sales"],
data : [300, 500, 100]
labels: ["Download Sales", "In-Store Sales", "Mail-Order Sales"],
data: [300, 500, 100]
};

$scope.polar = {
labels : ["Download Sales", "In-Store Sales", "Mail-Order Sales", "Tele Sales", "Corporate Sales"],
data : [300, 500, 100, 40, 120]
labels: ["Download Sales", "In-Store Sales", "Mail-Order Sales", "Tele Sales", "Corporate Sales"],
data: [300, 500, 100, 40, 120]
};

$scope.dynamic = {
labels : ["Download Sales", "In-Store Sales", "Mail-Order Sales", "Tele Sales", "Corporate Sales"],
data : [300, 500, 100, 40, 120],
type : 'PolarArea',
labels: ["Download Sales", "In-Store Sales", "Mail-Order Sales", "Tele Sales", "Corporate Sales"],
data: [300, 500, 100, 40, 120],
type: 'PolarArea',

toggle : function ()
{
this.type = this.type === 'PolarArea' ?
'Pie' : 'PolarArea';
}
toggle: function() {
this.type = this.type === 'PolarArea' ?
'Pie' : 'PolarArea';
}
};
}]);
}]);
Loading