scala - Reusable views in Play! Framework 2.6.2 -


i'm having problem importing partial/reusable view .scala.html file in play! framework (2.6.2).

my reusable component called _enhance.scala.html, in folder called partials , has modal code in it:

@() <link rel="stylesheet" media="screen" href="@routes.assets.versioned("css/modal.css")">  <div id="mymodal" class="modal">     <div class="modal-content">         <span class="close">&times;</span>         <p>some text in modal..</p>     </div> </div> 

in view trying import so:

@import views.html.partials._enhance 

and use so:

@_enhance 

in understanding doing should result in modal being imported html of page i'm importing to. not getting errors, result showing on screen:

basescalatemplate(play.twirl.api.htmlformat$@65195b0f)

this suggests screen rendering string of object, understanding. there bit i'm missing here?

any advice appreciated!

try @views.html.partials._enhance() directly (replace @_enhance it) , not need import in case


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -