1234567891011121314151617181920212223242526272829 |
- 'use strict';
- angular.module('app').run([ '$rootScope', '$state', function($rootScope, $state) {
- // $rootScope.$on('$stateChangeStart', function(event, toState, toParam,
- // fromState, fromParam) {
- // console.log('----------------------');
- // });
- // $rootScope.$on('$stateChangeError', function(event, toState, toParam,
- // fromState, fromParam) {
- // console.log('------------------333333----');
- // });
- } ]).config(function($stateProvider, $urlRouterProvider) {
- $urlRouterProvider.otherwise('/app/main');
- $stateProvider.state('app', {
- url : '/app',
- templateUrl : 'route/app.html'
- }).state('app.main', {
- url : '/main',
- templateUrl : 'route/main/main.html',
- resolve : {
- deps : [ '$ocLazyLoad', function($ocLazyLoad) {
- return $ocLazyLoad.load({
- files : [ 'route/main/main.js' ]
- });
- } ]
- }
- })
- });
|