使用带胡子的browserify时是否需要特殊的语法?

时间:2015-10-06 17:09:03

标签: javascript gulp browserify watchify

我正在使用浏览器和gulp,我在加载模板时遇到问题。有什么奇怪的,据我所知,我的路径是正确的,但我的模板不会加载。

这是我的目录结构:

directory structure

这是我的app.js文件:

$(function() {
    var EventUtility = {

        //EventUtilityCode
    };


    var flimFlam = document.getElementById('flimFlam');


    function templateLoader(e) {
        var doc = document,
            body = doc.getElementsByTagName('body'),
            overlay = $('#overlay');
        $.Mustache.load('../templates/index.html')
            .done(function() {
                $('body').mustache('templateID');
            });

        $('body').prepend(overlay);

    }

    EventUtility.addHandler(flimFlam, 'click', templateLoade

R);

这是我的模板:

<script id="templateID" type="text/html">
    <div id="overlay">
        <div id="container" class="container">
            <div class="row">
                <div class="twelve columns">
                   <div class="modal-container">
                        <div id="modal" class="modal-animation">
                            <p>This app will go through some of your markup to determmine if it could be more accessible.  We will start by checking the alt tags on your images, seeing if they exist, or if the tags are empty!<br>
                            <a id="appButton" class="button button-primary modal-button">lets get started!</a>
                            </p>
                        </div>
                   </div>
                </div>
            </div>
        </div>
    </div>
</script>

更新 有谁认为我应该使用这个module.exports = function () {}让我的胡子库工作?是吗?但其他库(例如jquery,mixitup)不需要这样做。所以我想那抓着吸管?

0 个答案:

没有答案