0

我正在将 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>

有任何想法吗?

4

1 回答 1

0

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

于 2014-12-04T21:19:26.663 回答