Skip to content

Instantly share code, notes, and snippets.

angular.module('ui.router').config(['$provide', function($provide) {
$provide.decorator('$controller', [
'$delegate', '$state',
function($delegate, $state) {
// the `later` and `ident` are private angular variables,
// that break the app if not present
return function(expression, locals, later, ident) {
if ($state.$current) {
locals = _.extend(locals, $state.$current.locals.globals);
}