how to add dependencies to $componentController in angular 1.5 while unit testing
<p>I want to add dependencies to my Controller in a component:</p>

<p>Here is my component:</p>

<pre><code>angular
  .module('app')
  .component('myComponent', {
    template: '&lt;div&gt;some content&lt;/div&gt;',
    controller: ["$routeParams", function ($routeParams) {
       var ctrl = this;
       ctrl.myId = $routeParams.id;
  });
</code></pre>

<p>Now I just want to test this as follow:</p>

<pre><code>describe("spec for myComponent", function () {

  var $componentController;
  var $routeParams;

  beforeEach(module('app'));
  beforeEach(inject(function (_$componentController_, _$routeParams_) {
    $componentController = _$componentController_;
    $routeParams = _$routeParams_;
    $routeParams = {
      myId: 42
    }
  }));

  it('should init', function () {

    var ctrl = $componentController('myComponent', $routeParams, null);

    expect(ctrl.myId).toBe(42);

  });
});
</code></pre>

<p>But unfortunately <strong>ctrl.myId is undefined</strong> because $routeParams are not correctly injected. Why?</p>