how to pass $scope to angularjs 1.5 component/directive
<p>I am trying to use the new .component() method in angular 1.5. Currently I have found little info on how to use it. The angular docs dont mention it really either.</p>

<p>I am trying to pass the scope or an object from the scope to the .component to be used in the template portion of the component but the only two parameters I can pass are $element and $attrs. I have tried passing the object through an attribute in the html but all I got was the string of the objects name.</p>

<p>I have tried setting it to be represented as a variable in these ways </p>

<pre><code>my-attr="item.myVal"
my-attr="{item.myVal}"
my-attr="{{item.myVal}}"
</code></pre>

<p>each time I still get the string literal and not the value of the variable. How can I set it to be treated as a variable?</p>

<p>I have tried capturing the data via the new bindings: {} but my template:{} didnt have access to the variables then.</p>

<p>Here is my component as it is now:</p>

<pre><code>export var ItemListAction = {
    controller: 'PanelCtrl as itemCtrl',
    isolate: false,
    template: ($element: any, $attrs: any): any=&gt; {
        var myVal: any = $attrs.myAttr; // returns "item.myVal"
        var listAction: string = compileListAction();
        return listAction;
    }
};
</code></pre>

<p>Here is my component in HTML</p>

<pre><code>&lt;panel-item-list-action my-attr="item.myVal"&gt;&lt;/panel-item-list-action&gt;
</code></pre>

<p>This is the angular module declaration for the component:<code>angular.module('Panel', []).component('panelItemListAction', ItemListAction)</code></p>