lib/ngapp/tpl.helper.js
function attachToScope(scope, itemsToAttach) {
        if (!itemsToAttach || !itemsToAttach.length) { return; }

        itemsToAttach.push(function () {
            var i, val;
            for (i = 0; i < arguments.length; i++) {
                val = arguments[i];
                scope[itemsToAttach[i]] = val;
            }
        });

        $injector.invoke(itemsToAttach);
    }
function attachToScope(scope, itemsToAttach) {
        if (!itemsToAttach || !itemsToAttach.length) { return; }

        itemsToAttach.push(function () {
            var i, val;
            for (i = 0; i < arguments.length; i++) {
                val = arguments[i];
                scope[itemsToAttach[i]] = val;
            }
        });

        $injector.invoke(itemsToAttach);
    }
function attachToScope ( scope , itemsToAttach ) { if ( ! itemsToAttach || ! itemsToAttach . length ) { return ; } itemsToAttach . push ( function ( ) { var i , val ; for ( i = 0 ; i < arguments . length ; i ++ ) { val = arguments [ i ] ; scope [ itemsToAttach [ i ] ] = val ; } } ) ; $injector . invoke ( itemsToAttach ) ; }
Given an array of items, instantiate them and attach them to the scope.
@param scope
@param itemsToAttach
Given an array of items instantiate them and attach them to the scope .