Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 1 | espaco | 1 | /*** |
| 2 | Metronic AngularJS App Main Script |
||
| 3 | ***/ |
||
| 4 | |||
| 5 | /* Metronic App */ |
||
| 6 | var MetronicApp = angular.module("MetronicApp", [ |
||
| 7 | "ui.router", |
||
| 8 | "ui.bootstrap", |
||
| 9 | "oc.lazyLoad", |
||
| 10 | "ngSanitize" |
||
| 11 | ]); |
||
| 12 | |||
| 13 | /* Configure ocLazyLoader(refer: https://github.com/ocombe/ocLazyLoad) */ |
||
| 14 | MetronicApp.config(['$ocLazyLoadProvider', function($ocLazyLoadProvider) { |
||
| 15 | $ocLazyLoadProvider.config({ |
||
| 16 | // global configs go here |
||
| 17 | }); |
||
| 18 | }]); |
||
| 19 | |||
| 20 | /******************************************** |
||
| 21 | BEGIN: BREAKING CHANGE in AngularJS v1.3.x: |
||
| 22 | *********************************************/ |
||
| 23 | /** |
||
| 24 | `$controller` will no longer look for controllers on `window`. |
||
| 25 | The old behavior of looking on `window` for controllers was originally intended |
||
| 26 | for use in examples, demos, and toy apps. We found that allowing global controller |
||
| 27 | functions encouraged poor practices, so we resolved to disable this behavior by |
||
| 28 | default. |
||
| 29 | |||
| 30 | To migrate, register your controllers with modules rather than exposing them |
||
| 31 | as globals: |
||
| 32 | |||
| 33 | Before: |
||
| 34 | |||
| 35 | ```javascript |
||
| 36 | function MyController() { |
||
| 37 | // ... |
||
| 38 | } |
||
| 39 | ``` |
||
| 40 | |||
| 41 | After: |
||
| 42 | |||
| 43 | ```javascript |
||
| 44 | angular.module('myApp', []).controller('MyController', [function() { |
||
| 45 | // ... |
||
| 46 | }]); |
||
| 47 | |||
| 48 | Although it's not recommended, you can re-enable the old behavior like this: |
||
| 49 | |||
| 50 | ```javascript |
||
| 51 | angular.module('myModule').config(['$controllerProvider', function($controllerProvider) { |
||
| 52 | // this option might be handy for migrating old apps, but please don't use it |
||
| 53 | // in new ones! |
||
| 54 | $controllerProvider.allowGlobals(); |
||
| 55 | }]); |
||
| 56 | **/ |
||
| 57 | |||
| 58 | //AngularJS v1.3.x workaround for old style controller declarition in HTML |
||
| 59 | MetronicApp.config(['$controllerProvider', function($controllerProvider) { |
||
| 60 | // this option might be handy for migrating old apps, but please don't use it |
||
| 61 | // in new ones! |
||
| 62 | $controllerProvider.allowGlobals(); |
||
| 63 | }]); |
||
| 64 | |||
| 65 | /******************************************** |
||
| 66 | END: BREAKING CHANGE in AngularJS v1.3.x: |
||
| 67 | *********************************************/ |
||
| 68 | |||
| 69 | /* Setup global settings */ |
||
| 70 | MetronicApp.factory('settings', ['$rootScope', function($rootScope) { |
||
| 71 | // supported languages |
||
| 72 | var settings = { |
||
| 73 | layout: { |
||
| 74 | pageSidebarClosed: false, // sidebar state |
||
| 75 | pageAutoScrollOnLoad: 1000 // auto scroll to top on page load |
||
| 76 | }, |
||
| 77 | layoutImgPath: Metronic.getAssetsPath() + 'admin/layout/img/', |
||
| 78 | layoutCssPath: Metronic.getAssetsPath() + 'admin/layout/css/' |
||
| 79 | }; |
||
| 80 | |||
| 81 | $rootScope.settings = settings; |
||
| 82 | |||
| 83 | return settings; |
||
| 84 | }]); |
||
| 85 | |||
| 86 | /* Setup App Main Controller */ |
||
| 87 | MetronicApp.controller('AppController', ['$scope', '$rootScope', function($scope, $rootScope) { |
||
| 88 | $scope.$on('$viewContentLoaded', function() { |
||
| 89 | Metronic.initComponents(); // init core components |
||
| 90 | //Layout.init(); // Init entire layout(header, footer, sidebar, etc) on page load if the partials included in server side instead of loading with ng-include directive |
||
| 91 | }); |
||
| 92 | }]); |
||
| 93 | |||
| 94 | /*** |
||
| 95 | Layout Partials. |
||
| 96 | By default the partials are loaded through AngularJS ng-include directive. In case they loaded in server side(e.g: PHP include function) then below partial |
||
| 97 | initialization can be disabled and Layout.init() should be called on page load complete as explained above. |
||
| 98 | ***/ |
||
| 99 | |||
| 100 | /* Setup Layout Part - Header */ |
||
| 101 | MetronicApp.controller('HeaderController', ['$scope', function($scope) { |
||
| 102 | $scope.$on('$includeContentLoaded', function() { |
||
| 103 | Layout.initHeader(); // init header |
||
| 104 | }); |
||
| 105 | }]); |
||
| 106 | |||
| 107 | /* Setup Layout Part - Sidebar */ |
||
| 108 | MetronicApp.controller('SidebarController', ['$scope', function($scope) { |
||
| 109 | $scope.$on('$includeContentLoaded', function() { |
||
| 110 | Layout.initSidebar(); // init sidebar |
||
| 111 | }); |
||
| 112 | }]); |
||
| 113 | |||
| 114 | /* Setup Layout Part - Theme Panel */ |
||
| 115 | MetronicApp.controller('ThemePanelController', ['$scope', function($scope) { |
||
| 116 | $scope.$on('$includeContentLoaded', function() { |
||
| 117 | Demo.init(); // init theme panel |
||
| 118 | }); |
||
| 119 | }]); |
||
| 120 | |||
| 121 | /* Setup Layout Part - Footer */ |
||
| 122 | MetronicApp.controller('FooterController', ['$scope', function($scope) { |
||
| 123 | $scope.$on('$includeContentLoaded', function() { |
||
| 124 | Layout.initFooter(); // init footer |
||
| 125 | }); |
||
| 126 | }]); |
||
| 127 | |||
| 128 | /* Setup Rounting For All Pages */ |
||
| 129 | MetronicApp.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { |
||
| 130 | |||
| 131 | // Redirect any unmatched url |
||
| 132 | $urlRouterProvider.otherwise("/dashboard.html"); |
||
| 133 | |||
| 134 | $stateProvider |
||
| 135 | |||
| 136 | // Dashboard |
||
| 137 | .state('dashboard', { |
||
| 138 | url: "/dashboard.html", |
||
| 139 | templateUrl: "views/dashboard.html", |
||
| 140 | data: {pageTitle: 'Admin Dashboard Template'}, |
||
| 141 | controller: "DashboardController", |
||
| 142 | resolve: { |
||
| 143 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 144 | return $ocLazyLoad.load({ |
||
| 145 | name: 'MetronicApp', |
||
| 146 | insertBefore: '#ng_load_plugins_before', // load the above css files before a LINK element with this ID. Dynamic CSS files must be loaded between core and theme css files |
||
| 147 | files: [ |
||
| 148 | '../../../assets/global/plugins/morris/morris.css', |
||
| 149 | '../../../assets/admin/pages/css/tasks.css', |
||
| 150 | |||
| 151 | '../../../assets/global/plugins/morris/morris.min.js', |
||
| 152 | '../../../assets/global/plugins/morris/raphael-min.js', |
||
| 153 | '../../../assets/global/plugins/jquery.sparkline.min.js', |
||
| 154 | |||
| 155 | '../../../assets/admin/pages/scripts/index3.js', |
||
| 156 | '../../../assets/admin/pages/scripts/tasks.js', |
||
| 157 | |||
| 158 | 'js/controllers/DashboardController.js' |
||
| 159 | ] |
||
| 160 | }); |
||
| 161 | }] |
||
| 162 | } |
||
| 163 | }) |
||
| 164 | |||
| 165 | // AngularJS plugins |
||
| 166 | .state('fileupload', { |
||
| 167 | url: "/file_upload.html", |
||
| 168 | templateUrl: "views/file_upload.html", |
||
| 169 | data: {pageTitle: 'AngularJS File Upload'}, |
||
| 170 | controller: "GeneralPageController", |
||
| 171 | resolve: { |
||
| 172 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 173 | return $ocLazyLoad.load([{ |
||
| 174 | name: 'angularFileUpload', |
||
| 175 | files: [ |
||
| 176 | '../../../assets/global/plugins/angularjs/plugins/angular-file-upload/angular-file-upload.min.js', |
||
| 177 | ] |
||
| 178 | }, { |
||
| 179 | name: 'MetronicApp', |
||
| 180 | files: [ |
||
| 181 | 'js/controllers/GeneralPageController.js' |
||
| 182 | ] |
||
| 183 | }]); |
||
| 184 | }] |
||
| 185 | } |
||
| 186 | }) |
||
| 187 | |||
| 188 | // UI Select |
||
| 189 | .state('uiselect', { |
||
| 190 | url: "/ui_select.html", |
||
| 191 | templateUrl: "views/ui_select.html", |
||
| 192 | data: {pageTitle: 'AngularJS Ui Select'}, |
||
| 193 | controller: "UISelectController", |
||
| 194 | resolve: { |
||
| 195 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 196 | return $ocLazyLoad.load([{ |
||
| 197 | name: 'ui.select', |
||
| 198 | insertBefore: '#ng_load_plugins_before', // load the above css files before '#ng_load_plugins_before' |
||
| 199 | files: [ |
||
| 200 | '../../../assets/global/plugins/angularjs/plugins/ui-select/select.min.css', |
||
| 201 | '../../../assets/global/plugins/angularjs/plugins/ui-select/select.min.js' |
||
| 202 | ] |
||
| 203 | }, { |
||
| 204 | name: 'MetronicApp', |
||
| 205 | files: [ |
||
| 206 | 'js/controllers/UISelectController.js' |
||
| 207 | ] |
||
| 208 | }]); |
||
| 209 | }] |
||
| 210 | } |
||
| 211 | }) |
||
| 212 | |||
| 213 | // UI Bootstrap |
||
| 214 | .state('uibootstrap', { |
||
| 215 | url: "/ui_bootstrap.html", |
||
| 216 | templateUrl: "views/ui_bootstrap.html", |
||
| 217 | data: {pageTitle: 'AngularJS UI Bootstrap'}, |
||
| 218 | controller: "GeneralPageController", |
||
| 219 | resolve: { |
||
| 220 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 221 | return $ocLazyLoad.load([{ |
||
| 222 | name: 'MetronicApp', |
||
| 223 | files: [ |
||
| 224 | 'js/controllers/GeneralPageController.js' |
||
| 225 | ] |
||
| 226 | }]); |
||
| 227 | }] |
||
| 228 | } |
||
| 229 | }) |
||
| 230 | |||
| 231 | // Tree View |
||
| 232 | .state('tree', { |
||
| 233 | url: "/tree", |
||
| 234 | templateUrl: "views/tree.html", |
||
| 235 | data: {pageTitle: 'jQuery Tree View'}, |
||
| 236 | controller: "GeneralPageController", |
||
| 237 | resolve: { |
||
| 238 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 239 | return $ocLazyLoad.load([{ |
||
| 240 | name: 'MetronicApp', |
||
| 241 | insertBefore: '#ng_load_plugins_before', // load the above css files before '#ng_load_plugins_before' |
||
| 242 | files: [ |
||
| 243 | '../../../assets/global/plugins/jstree/dist/themes/default/style.min.css', |
||
| 244 | |||
| 245 | '../../../assets/global/plugins/jstree/dist/jstree.min.js', |
||
| 246 | '../../../assets/admin/pages/scripts/ui-tree.js', |
||
| 247 | 'js/controllers/GeneralPageController.js' |
||
| 248 | ] |
||
| 249 | }]); |
||
| 250 | }] |
||
| 251 | } |
||
| 252 | }) |
||
| 253 | |||
| 254 | // Form Tools |
||
| 255 | .state('formtools', { |
||
| 256 | url: "/form-tools", |
||
| 257 | templateUrl: "views/form_tools.html", |
||
| 258 | data: {pageTitle: 'Form Tools'}, |
||
| 259 | controller: "GeneralPageController", |
||
| 260 | resolve: { |
||
| 261 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 262 | return $ocLazyLoad.load([{ |
||
| 263 | name: 'MetronicApp', |
||
| 264 | insertBefore: '#ng_load_plugins_before', // load the above css files before '#ng_load_plugins_before' |
||
| 265 | files: [ |
||
| 266 | '../../../assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.css', |
||
| 267 | '../../../assets/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css', |
||
| 268 | '../../../assets/global/plugins/jquery-tags-input/jquery.tagsinput.css', |
||
| 269 | '../../../assets/global/plugins/bootstrap-markdown/css/bootstrap-markdown.min.css', |
||
| 270 | '../../../assets/global/plugins/typeahead/typeahead.css', |
||
| 271 | |||
| 272 | '../../../assets/global/plugins/fuelux/js/spinner.min.js', |
||
| 273 | '../../../assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js', |
||
| 274 | '../../../assets/global/plugins/jquery-inputmask/jquery.inputmask.bundle.min.js', |
||
| 275 | '../../../assets/global/plugins/jquery.input-ip-address-control-1.0.min.js', |
||
| 276 | '../../../assets/global/plugins/bootstrap-pwstrength/pwstrength-bootstrap.min.js', |
||
| 277 | '../../../assets/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js', |
||
| 278 | '../../../assets/global/plugins/jquery-tags-input/jquery.tagsinput.min.js', |
||
| 279 | '../../../assets/global/plugins/bootstrap-maxlength/bootstrap-maxlength.min.js', |
||
| 280 | '../../../assets/global/plugins/bootstrap-touchspin/bootstrap.touchspin.js', |
||
| 281 | '../../../assets/global/plugins/typeahead/handlebars.min.js', |
||
| 282 | '../../../assets/global/plugins/typeahead/typeahead.bundle.min.js', |
||
| 283 | '../../../assets/admin/pages/scripts/components-form-tools.js', |
||
| 284 | |||
| 285 | 'js/controllers/GeneralPageController.js' |
||
| 286 | ] |
||
| 287 | }]); |
||
| 288 | }] |
||
| 289 | } |
||
| 290 | }) |
||
| 291 | |||
| 292 | // Date & Time Pickers |
||
| 293 | .state('pickers', { |
||
| 294 | url: "/pickers", |
||
| 295 | templateUrl: "views/pickers.html", |
||
| 296 | data: {pageTitle: 'Date & Time Pickers'}, |
||
| 297 | controller: "GeneralPageController", |
||
| 298 | resolve: { |
||
| 299 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 300 | return $ocLazyLoad.load([{ |
||
| 301 | name: 'MetronicApp', |
||
| 302 | insertBefore: '#ng_load_plugins_before', // load the above css files before '#ng_load_plugins_before' |
||
| 303 | files: [ |
||
| 304 | '../../../assets/global/plugins/clockface/css/clockface.css', |
||
| 305 | '../../../assets/global/plugins/bootstrap-datepicker/css/datepicker3.css', |
||
| 306 | '../../../assets/global/plugins/bootstrap-timepicker/css/bootstrap-timepicker.min.css', |
||
| 307 | '../../../assets/global/plugins/bootstrap-colorpicker/css/colorpicker.css', |
||
| 308 | '../../../assets/global/plugins/bootstrap-daterangepicker/daterangepicker-bs3.css', |
||
| 309 | '../../../assets/global/plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css', |
||
| 310 | |||
| 311 | '../../../assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js', |
||
| 312 | '../../../assets/global/plugins/bootstrap-timepicker/js/bootstrap-timepicker.min.js', |
||
| 313 | '../../../assets/global/plugins/clockface/js/clockface.js', |
||
| 314 | '../../../assets/global/plugins/bootstrap-daterangepicker/moment.min.js', |
||
| 315 | '../../../assets/global/plugins/bootstrap-daterangepicker/daterangepicker.js', |
||
| 316 | '../../../assets/global/plugins/bootstrap-colorpicker/js/bootstrap-colorpicker.js', |
||
| 317 | '../../../assets/global/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js', |
||
| 318 | |||
| 319 | '../../../assets/admin/pages/scripts/components-pickers.js', |
||
| 320 | |||
| 321 | 'js/controllers/GeneralPageController.js' |
||
| 322 | ] |
||
| 323 | }]); |
||
| 324 | }] |
||
| 325 | } |
||
| 326 | }) |
||
| 327 | |||
| 328 | // Custom Dropdowns |
||
| 329 | .state('dropdowns', { |
||
| 330 | url: "/dropdowns", |
||
| 331 | templateUrl: "views/dropdowns.html", |
||
| 332 | data: {pageTitle: 'Custom Dropdowns'}, |
||
| 333 | controller: "GeneralPageController", |
||
| 334 | resolve: { |
||
| 335 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 336 | return $ocLazyLoad.load([{ |
||
| 337 | name: 'MetronicApp', |
||
| 338 | insertBefore: '#ng_load_plugins_before', // load the above css files before '#ng_load_plugins_before' |
||
| 339 | files: [ |
||
| 340 | '../../../assets/global/plugins/bootstrap-select/bootstrap-select.min.css', |
||
| 341 | '../../../assets/global/plugins/select2/select2.css', |
||
| 342 | '../../../assets/global/plugins/jquery-multi-select/css/multi-select.css', |
||
| 343 | |||
| 344 | '../../../assets/global/plugins/bootstrap-select/bootstrap-select.min.js', |
||
| 345 | '../../../assets/global/plugins/select2/select2.min.js', |
||
| 346 | '../../../assets/global/plugins/jquery-multi-select/js/jquery.multi-select.js', |
||
| 347 | |||
| 348 | '../../../assets/admin/pages/scripts/components-dropdowns.js', |
||
| 349 | |||
| 350 | 'js/controllers/GeneralPageController.js' |
||
| 351 | ] |
||
| 352 | }]); |
||
| 353 | }] |
||
| 354 | } |
||
| 355 | }) |
||
| 356 | |||
| 357 | // Advanced Datatables |
||
| 358 | .state('datatablesAdvanced', { |
||
| 359 | url: "/datatables/advanced.html", |
||
| 360 | templateUrl: "views/datatables/advanced.html", |
||
| 361 | data: {pageTitle: 'Advanced Datatables'}, |
||
| 362 | controller: "GeneralPageController", |
||
| 363 | resolve: { |
||
| 364 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 365 | return $ocLazyLoad.load({ |
||
| 366 | name: 'MetronicApp', |
||
| 367 | insertBefore: '#ng_load_plugins_before', // load the above css files before '#ng_load_plugins_before' |
||
| 368 | files: [ |
||
| 369 | '../../../assets/global/plugins/select2/select2.css', |
||
| 370 | '../../../assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css', |
||
| 371 | '../../../assets/global/plugins/datatables/extensions/Scroller/css/dataTables.scroller.min.css', |
||
| 372 | '../../../assets/global/plugins/datatables/extensions/ColReorder/css/dataTables.colReorder.min.css', |
||
| 373 | |||
| 374 | '../../../assets/global/plugins/select2/select2.min.js', |
||
| 375 | '../../../assets/global/plugins/datatables/all.min.js', |
||
| 376 | 'js/scripts/table-advanced.js', |
||
| 377 | |||
| 378 | 'js/controllers/GeneralPageController.js' |
||
| 379 | ] |
||
| 380 | }); |
||
| 381 | }] |
||
| 382 | } |
||
| 383 | }) |
||
| 384 | |||
| 385 | // Ajax Datetables |
||
| 386 | .state('datatablesAjax', { |
||
| 387 | url: "/datatables/ajax.html", |
||
| 388 | templateUrl: "views/datatables/ajax.html", |
||
| 389 | data: {pageTitle: 'Ajax Datatables'}, |
||
| 390 | controller: "GeneralPageController", |
||
| 391 | resolve: { |
||
| 392 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 393 | return $ocLazyLoad.load({ |
||
| 394 | name: 'MetronicApp', |
||
| 395 | insertBefore: '#ng_load_plugins_before', // load the above css files before '#ng_load_plugins_before' |
||
| 396 | files: [ |
||
| 397 | '../../../assets/global/plugins/select2/select2.css', |
||
| 398 | '../../../assets/global/plugins/bootstrap-datepicker/css/datepicker.css', |
||
| 399 | '../../../assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css', |
||
| 400 | |||
| 401 | '../../../assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js', |
||
| 402 | '../../../assets/global/plugins/select2/select2.min.js', |
||
| 403 | '../../../assets/global/plugins/datatables/all.min.js', |
||
| 404 | |||
| 405 | '../../../assets/global/scripts/datatable.js', |
||
| 406 | 'js/scripts/table-ajax.js', |
||
| 407 | |||
| 408 | 'js/controllers/GeneralPageController.js' |
||
| 409 | ] |
||
| 410 | }); |
||
| 411 | }] |
||
| 412 | } |
||
| 413 | }) |
||
| 414 | |||
| 415 | // User Profile |
||
| 416 | .state("profile", { |
||
| 417 | url: "/profile", |
||
| 418 | templateUrl: "views/profile/main.html", |
||
| 419 | data: {pageTitle: 'User Profile'}, |
||
| 420 | controller: "UserProfileController", |
||
| 421 | resolve: { |
||
| 422 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 423 | return $ocLazyLoad.load({ |
||
| 424 | name: 'MetronicApp', |
||
| 425 | insertBefore: '#ng_load_plugins_before', // load the above css files before '#ng_load_plugins_before' |
||
| 426 | files: [ |
||
| 427 | '../../../assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.css', |
||
| 428 | '../../../assets/admin/pages/css/profile.css', |
||
| 429 | '../../../assets/admin/pages/css/tasks.css', |
||
| 430 | |||
| 431 | '../../../assets/global/plugins/jquery.sparkline.min.js', |
||
| 432 | '../../../assets/global/plugins/bootstrap-fileinput/bootstrap-fileinput.js', |
||
| 433 | |||
| 434 | '../../../assets/admin/pages/scripts/profile.js', |
||
| 435 | |||
| 436 | 'js/controllers/UserProfileController.js' |
||
| 437 | ] |
||
| 438 | }); |
||
| 439 | }] |
||
| 440 | } |
||
| 441 | }) |
||
| 442 | |||
| 443 | // User Profile Dashboard |
||
| 444 | .state("profile.dashboard", { |
||
| 445 | url: "/dashboard", |
||
| 446 | templateUrl: "views/profile/dashboard.html", |
||
| 447 | data: {pageTitle: 'User Profile'} |
||
| 448 | }) |
||
| 449 | |||
| 450 | // User Profile Account |
||
| 451 | .state("profile.account", { |
||
| 452 | url: "/account", |
||
| 453 | templateUrl: "views/profile/account.html", |
||
| 454 | data: {pageTitle: 'User Account'} |
||
| 455 | }) |
||
| 456 | |||
| 457 | // User Profile Help |
||
| 458 | .state("profile.help", { |
||
| 459 | url: "/help", |
||
| 460 | templateUrl: "views/profile/help.html", |
||
| 461 | data: {pageTitle: 'User Help'} |
||
| 462 | }) |
||
| 463 | |||
| 464 | // Todo |
||
| 465 | .state('todo', { |
||
| 466 | url: "/todo", |
||
| 467 | templateUrl: "views/todo.html", |
||
| 468 | data: {pageTitle: 'Todo'}, |
||
| 469 | controller: "TodoController", |
||
| 470 | resolve: { |
||
| 471 | deps: ['$ocLazyLoad', function($ocLazyLoad) { |
||
| 472 | return $ocLazyLoad.load({ |
||
| 473 | name: 'MetronicApp', |
||
| 474 | insertBefore: '#ng_load_plugins_before', // load the above css files before '#ng_load_plugins_before' |
||
| 475 | files: [ |
||
| 476 | '../../../assets/global/plugins/bootstrap-datepicker/css/datepicker3.css', |
||
| 477 | '../../../assets/global/plugins/select2/select2.css', |
||
| 478 | '../../../assets/admin/pages/css/todo.css', |
||
| 479 | |||
| 480 | '../../../assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js', |
||
| 481 | '../../../assets/global/plugins/select2/select2.min.js', |
||
| 482 | |||
| 483 | '../../../assets/admin/pages/scripts/todo.js', |
||
| 484 | |||
| 485 | 'js/controllers/TodoController.js' |
||
| 486 | ] |
||
| 487 | }); |
||
| 488 | }] |
||
| 489 | } |
||
| 490 | }) |
||
| 491 | |||
| 492 | }]); |
||
| 493 | |||
| 494 | /* Init global settings and run the app */ |
||
| 495 | MetronicApp.run(["$rootScope", "settings", "$state", function($rootScope, settings, $state) { |
||
| 496 | $rootScope.$state = $state; // state to be accessed from view |
||
| 497 | }]); |