Giter Club home page Giter Club logo

Comments (6)

donaldpipowitch avatar donaldpipowitch commented on September 20, 2024

Do you see an Unexpected token . error? I think this happens because of this. I import xx from 'x.html'; and want to use it like that: let foo = { xx }. Which I guess compiles to something like var foo = { xx: xx.default }

from html-loader.

fisherspy avatar fisherspy commented on September 20, 2024

Hi, thanks for replying. I would like to show you the code(Angular 2):
source:

import TabsHtmls from './bi-tabs.html';

@Component({
  selector: 'bi-tabs',
  template: TabsHtmls, // need to be string
  styles: [".bi-tabs{background-color:red}"],
  directives: [ROUTER_DIRECTIVES],
})

build :

var bi_tabs_html_1 = __webpack_require__(352);
    var BiTabs = (function () {
        function BiTabs() {
        }
        __decorate([
            core_1.Input(), 
            __metadata('design:type', Array)
        ], BiTabs.prototype, "biTabsConfigs", void 0);
        BiTabs = __decorate([
            core_1.Component({
                selector: 'bi-tabs',
                template: bi_tabs_html_1.default, // default
                styles: [".bi-tabs{background-color:red}"],
                directives: [router_1.ROUTER_DIRECTIVES],
            }), 
            __metadata('design:paramtypes', [])
        ], BiTabs);
        return BiTabs;
    })();

/* 352 */
/***/ function(module, exports, __webpack_require__) {

    module.e = "<div\n  hello\n</div>";

/***/ }

from html-loader.

laland avatar laland commented on September 20, 2024

looks like this PR does it #97
it's already merged

from html-loader.

staeke avatar staeke commented on September 20, 2024

cool...can you publish a new npm version so we can easily use this feature?

from html-loader.

laland avatar laland commented on September 20, 2024

@sokra can

from html-loader.

staeke avatar staeke commented on September 20, 2024

looking forward to it!

from html-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.