Q:

Trying to pass a local variable to my ngAside controller

I am using ngAside to display some data. The data depends on a variable chosen by the user so I need to pass an Id to ngAside's controller. 
Right now my controller looks like this:
$aside.open({
    templateUrl: 'details.html',
    placement: position,
    size: 'lg',
    backdrop: true, 
    locals: {
        mode: "create"
    },
    controller: function Ctrl($scope, $uibModalInstance, mode) {
        $scope.test = mode;
        $scope.ok = function (e) {
            $uibModalInstance.close();
            e.stopPropagation();
        };
        $scope.cancel = function (e) {
            $uibModalInstance.dismiss();
            e.stopPropagation();
        };
    }
})

I have based this on what I've seen written on ngMaterial here.
It is not working as expected though and Im getting 
Unknown provider: modeProvider <- mode

How can I fix this and be able to pass variables to be displayed on my ngAside template?

A:

Since you want to inject "mode" variable in a controller, my guess would be using the standard "resolve" parameter.
$aside.open({
  templateUrl: 'details.html',
  placement: position,
  size: 'lg',
  backdrop: true, 
  resolve: {
    mode: function() {
      return "create";
    }
  },
  controller: function Ctrl($scope, $uibModalInstance, mode) {
    [...]
  }
});

Basically, for each controller parameter that is not registered in the Dependency Injection list, you need to provide a function which will return the value you want to be injected in the variable.
This function :
  mode: function() {
    return "create";
  }

Will be executed and its return value will populate the "mode" controller argument.

