Created
August 9, 2014 20:11
-
-
Save raypulver/3354afd66c256c186800 to your computer and use it in GitHub Desktop.
soundManager states
This file contains hidden or 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('soundManager', ['ui.router']).config(function ($stateProvider, $urlRouterProvider) { | |
| $urlRouterProvider.otherwise('/main/nested'); | |
| $stateProvider.state('main', { | |
| url: '/main', | |
| controller: function (sm) { // code with sm (sound manager) here }, | |
| templateUrl: 'index.html', | |
| resolve: { | |
| sm: function (soundManager) { | |
| return soundManager(); | |
| } | |
| } | |
| }) | |
| .state('level.nested', { | |
| url: '/nested', | |
| controller: function (sm) { // this ctrl gets access to sm too }, | |
| templateUrl: 'nested.html' | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment