我随机开始收到此错误 Uncaught Error: Assertion Failed: Attempted to register a view with an id already in use: name
在我的应用程序上使用 ember-cli。
我只有两条路线
Router.map(function() {
this.route('buy');
this.route('rent');
});
没有 Controller ,我的索引路由将我重定向到
buy
redirect: function() {
this.transitionTo('buy');
}
和我的
rent
路由也呈现 buy
模板renderTemplate: function() {
this.render('buy');
}
我没有
rent
或 index
模板。我不知道这个错误是从哪里来的。
最佳答案
我想通了为什么,原来我的模板上有两个具有相同 ID 的输入,{{ input name="name" id="name" placeholder="Full Name" class="full-width" }}
在不同的地方两次。如果错误消息可以提供更多信息并在实际代码中为您提供一行而不是仅显示行 throw new EmberError("Assertion Failed: " + desc);
,那将会很有用。关于你 vendor.js
文件。
关于javascript - Uncaught Error : Assertion Failed: Attempted to register a view with an id already in use: name,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27029299/