Question

As you may know Spine controllers create their DOM elements ( <div> by default ). How could we prevent creating such elements and use only markup in the view?

I read the documentation but didn't find any information.

Était-ce utile?

La solution

The relevant line is https://github.com/spine/spine/blob/dev/src/spine.coffee#L488, which says:

@el  = document.createElement(@tag) unless @el

In order to avoid having the element be created, you can pass in an el to the constructor. Alternatively, you can call @replace() in your render method to replace the div with your own element.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top