Created
August 7, 2017 12:01
-
-
Save houming818/3e8a290569efa0a79e846acff1a05586 to your computer and use it in GitHub Desktop.
angluarjs dynamic states example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('MetronicApp').controller('LvsGroupsController', function($model, $scope, localStorageService, $rootScope, $http, $timeout, runtimeStates, $state) { | |
runtimeStates.addState('lvs', { | |
name: 'lvs', | |
url: '/lvs', | |
data: {pageTitle: 'Lvs中心'}, | |
templateUrl: '/static/views/lvs/main.html', | |
resolve: { | |
deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
return $ocLazyLoad.load({ | |
name: 'MetronicApp', | |
insertBefore: '#ng_load_plugins_bebore', | |
files: ['/static/js/lvs/workflow.js'] | |
}); | |
}] | |
} | |
}); | |
runtimeStates.addState('lvs.group', { | |
name: 'lvs.group', | |
url: '/group', | |
data: {pageTitle: 'Lvs中心.group'}, | |
templateUrl: '/static/views/lvs/workflow.html', | |
resolve: { | |
deps: ['$ocLazyLoad', function($ocLazyLoad) { | |
return $ocLazyLoad.load({ | |
name: 'MetronicApp', | |
insertBefore: '#ng_load_plugins_bebore', | |
files: ['/static/js/lvs/workflow.js'] | |
}); | |
}] | |
} | |
}); | |
$scope.new = function() { | |
$state.go('lvs.group'); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment