         abstract: true
         url: '/:collection/subject/{subject:[0-9]+}'
         resolve:
-          subject: ['$stateParams', 'Subject',
-            ($stateParams, Subject) ->
-              getSubject($stateParams, Subject)
-          ]
+          subject: (project, $stateParams, Subject) ->
+            getSubject(project, $stateParams, Subject)
       
       # The subject detail page.
       .state 'quip.subject.detail',
         url: '?detail'
         resolve:
-          detail: ['Subject', 'subject',
-            (Subject, subject) ->
-              Subject.detail(id: subject.detail)
-          ]
+          detail: (subject, Subject) ->
+            getSubjectDetail(subject, Subject)
         views:
           'main@':
             templateUrl: '/partials/subject-detail.html'

      else
        resource.get(sbj).$promise
    
    $stateProvider
      # The top-level state. This abstract state is the ancestor
      # of all other states. It holds the url prefix. There are
      # two ui-views in the index.html file: main and goHome. This
      # top-level state formats the goHome navigation button. The
      # main ui-view is formatted by child states. Since the main
      # ui-view is in the root context, it is referenced by the


routes.config ['$stateProvider', '$urlRouterProvider', '$locationProvider',
  ($stateProvider, $urlRouterProvider, $locationProvider) ->
    # Make a subject from the given route parameters. If there
    # is not a detail parameter, then fetch the subject from the
    # Subject resource.
    #
    # @param project the project
    # @param params the URL parameters 
    # @param resource the Subject resource
    # @returns the subject
    getSubject = (project, params, resource) ->
      sbj =
        project: project
        collection: _.str.capitalize(params.collection)
        number: parseInt(params.subject)
      if params.detail
