Ember模板,编译后在HTML中内联时出错

时间:2014-11-20 18:02:31

标签: javascript ember.js gulp inline-code grunt-ember-templates

我正在将Ember模板编译成JS源文件,该文件在HTML中作为外部源加载时正确加载。

但是,当我将相同的源文件内联到HTML(当前项目所需)时,我在浏览器控制台上收到以下错误:

Uncaught Error: Assertion Failed: An error occured while setting up template bindings. Please check "index" template for invalid markup or bindings within HTML comments.

失败的模板代码如下:

<nav class="navbar navbar-default navbar-fixed-top" role="navigation">

    <div class="inner-nav">
        <a class="navbar-brand" rel="home">
            <img src="img/logo.png">
        </a>
    </div>
</nav>

<main class="login">

    <div class="background-image">
        <div class="color-overlay"></div>
    </div>

    <div class="container">
        <aside>
            <h4>Title</h4>

            <p>Intro text, lorem ipsum, lahlahlah, etc.</    p>
        </aside>

        <article>
            <div class="panel panel-default">
                <div class="panel-heading">Sign in</div>
                <div class="panel-body">
                    <form role="form" {{action "login" on="submit"}}>
                        <div class="form-group">
                            <label for="email">Email address</label>
                            {{input placeholder="Your email" id="email" class="form-control"     value=username}}
                        </div>
                        <div class="form-group">
                            <label for="password">Password</label>
                            {{input type="password" placeholder="Your password" id="password"     class="form-control" value=password}}
                        </div>
                        <label class='button-label'><a>Forgot password?</a></label>
                        <button type="submit" class="btn btn-primary pull-right">Sign in</button>
                    </form>
                </div>
            </div>

            <div class="panel panel-default">
                <div class="panel-body">
                    <label class='button-label'>New user?</label>    
                    <button type="submit" class="btn btn-default pull-right">Sign up</button>
                </div>
            </div>
        </article>
    </div>
</main>

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

尝试使用输入助手中的classNames属性而不是class,看看是否有帮助。