LinkedInAttic / hopscotch

A framework to make it easy for developers to add product tours to their pages.
Apache License 2.0
4.19k stars 664 forks source link

Possibility to use a compile function to display the template #336

Closed Akta3d closed 6 months ago

Akta3d commented 7 years ago
            compileTemplate: function(el, html)
            {
                while (el.firstChild) {
                    el.removeChild(el.firstChild);
                }

                var newScope = $rootScope.$new();
                var els = $compile(html)(newScope);

                var angularElem = angular.element(el);
                angularElem.append(els);
            },
timlindvall commented 7 years ago

Couple of things...

1) Is there really no way in your use case to have the template return HTML content and let Hopscotch handle the DOM operations? 2) Please use 2 spaces for indentation. 😃

Akta3d commented 7 years ago

Sorry for indentation.

I need compile the template with angular before add DOM element