| angular.module('app') | |
| .config(function($routeProvider) { | |
| $routeProvider | |
| .when('/:foo', { | |
| controller: 'MainCtrl' | |
| }); | |
| }); | |
| angular | |
| .module('app') | |
| .controller('MainCtrl', MainCtrl); | |
| function MainCtrl(config, $scope, $http, $rootScope, $log, $sce, $routeParams, Socket){ | |
| /* This is what I *have* to do! */ | |
| var stuff = function(stuff){ | |
| $log.info('funciton says', stuff); | |
| } | |
| $scope.$on('$routeChangeSuccess', function() { | |
| stuff($routeParams.foo); | |
| }); | |
| /* this is what I *should* be able to do but doens't work! */ | |
| var foo = $routeParams.foo; | |
| $log.info('foo', foo); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment