3
虽然两者都包含在同一个HTML文件中,但我在不同的JS文档中定义了两条路由。 1号线是这样的:在CanJS中使用can.Control.route定义两个单独的路由器
Router = can.Control({
"invoices/:id route": function(data){
//load an invoice by id
}
});
而另外一个是这样的:!
Router = can.Control({
"receipts/:id route": function(data){
//load a receipt by id
}
});
当我浏览到#收据/ 1两个收据和发票被实例化。为什么是这样的,我该如何解决它?