Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserting dynamic content into a copied element #121

Open
johnpolitowski opened this issue Nov 28, 2017 · 1 comment
Open

Inserting dynamic content into a copied element #121

johnpolitowski opened this issue Nov 28, 2017 · 1 comment

Comments

@johnpolitowski
Copy link

I'm trying to insert some dynamic content into to copied elements, such as unique id, and a directive depending on what is dragged. Is that possible?

@johnpolitowski
Copy link
Author

johnpolitowski commented Nov 29, 2017

Actually I figured it out. It can be accessed by innerHTML of target

    $scope.$on('script-editor.drop', function (el, target, source, sibling) {
        console.log('target', target);
        angular.forEach(target[0].classList, function(className){
            if(className == 'template'){
                //console.log('got one!');
                target[0].innerHTML = 'boombap';
            }
        });
    });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant