superdesk/superdesk-client-core

View on GitHub
scripts/apps/packaging/directives/PackageItemProxy.ts

Summary

Maintainability
A
0 mins
Test Coverage
PackageItemProxy.$inject = ['$compile'];
export function PackageItemProxy($compile) {
    var template =
        '<div sd-package-item data-id="id"' +
            ' data-item="item"' +
            ' data-setitem="setitem({selected: selected})"' +
            ' data-mode="mode">' +
        '</div>';

    return {
        scope: {
            id: '=',
            item: '=',
            setitem: '&',
            mode: '=',
        },
        link: function(scope, elem) {
            elem.append($compile(template)(scope));
        },
    };
}