Add link to cockpit navigation with dynamic value


I’d like to add a link to the navigation in the cockpit application(next to Processes, Decisions, …).
I was able to create the link by modifying an example

define(['angular'], function (angular) {   
  var Configuration = function Configuration(ViewsProvider) {
       ViewsProvider.registerDefaultView('cockpit.navigation', {
           id: 'cockpit-plugin',
           label: 'MY_LINK',                
           pagePath: 'http://something',
           priority: 200

This works fine and the link is added:

The problem is that I need to retrieve the http://something from the server.
I can do that when defining a controller function using

        .success(function (data) {
            $ = data;

But I don’t know how to get this value into the pagePath in the configuration. The solution is probably simple, but I have a very limited knowledge of AngularJS. I cannot figure out how to inject $http outside of the scope of controller function or how to synchronously wait for the result.