Skip to content

Instantly share code, notes, and snippets.

@raypulver
Created August 9, 2014 20:11
Show Gist options
  • Select an option

  • Save raypulver/3354afd66c256c186800 to your computer and use it in GitHub Desktop.

Select an option

Save raypulver/3354afd66c256c186800 to your computer and use it in GitHub Desktop.
soundManager states
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