Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.
This repository was archived by the owner on May 29, 2019. It is now read-only.

Modal Resolution Not Using Locals #3405

@micah-williamson

Description

@micah-williamson

If a modal resolution contains another resolution from the same resolve block it will fail. This is not working as expected (like ui-router).

Steps to reproduce:

  • Create a Controller called MainCtrl that injects the $modal service with a scope method called openModal()
  • Create a view MainCtrl is controller. Create a button that, when clicked, calls openModal()
  • In the openModal() method use the $modal service to call $modal.open()
  • In the $modal.open call add two resolutions. The second resolution should attempt to use the first resolution.
angular.module('app', ['ui.bootstrap'])
  .controller('MainCtrl', function($scope, $modal) {

    $scope.openModal = function() {
      $modal.open({
        template: 'hello'
      });
    };

    $scope.openModal2 = function() {
      $modal.open({
        template: 'hello',
        resolve: {
          r1: function() {
            return 'hello';
          },
          // Will fail
          r2: function(r1) {
            return r1 + ' world!';
          }
        }
      });
    };

  });

JSBin: http://jsbin.com/riyijuqolu/1/edit?js,console,output

Please address.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions