Làm cách nào để đặt liên kết để định tuyến với phân khúc động. Theo hướng dẫn tôi bắt đầu với điều nàyLàm cách nào để đặt liên kết để định tuyến bằng phân đoạn động
window.App = Ember.Application.create()
App.Router.map ->
@resource 'products'
@resource 'product', path: '/product/:product_id'
trong mẫu của tôi:
{{#linkTo "product.1"}}products{{/linkTo}}
Đáng tiếc là điều này mang lại cho tôi những lỗi follwing:
Uncaught Error: assertion failed: The attempt to linkTo route 'product.1' failed.
The router did not find 'product.1' in its possible routes: 'products', 'product', 'index'
Trong vòng lặp '# each' tôi phải báo giá' product': '{{#linkTo 'product' this}} Chi tiết {{/ linkTo}}'. –