Skip to content

Support partial HTML markup #1

@fernandoacorreia

Description

@fernandoacorreia

A feature for discussion:

I propose the loader should have an option not to require a full HTML document, within <html> tags.

I'd like to use the html loader to load an HTML snippet (representing a template) as text into a variable.

The snippet would look like this:

<!-- List item template. -->
<li>
  <a href="#">
    <h3>#{number} {customer}</h3>
    <p>{title}</p>
    <span class="ui-li-count">{status}</span> <!-- shows status -->
    <p class="ui-li-aside"><strong>{time}</strong></p>
  </a>
</li>

And I would include it like this:

var listTemplate = require('html!templates/listItem.html');

Currently I'm doing that using the raw loader, but I'd like to be able to keep including templates but to have other HTML-specific options (specially minification).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions