如何正确使用angularjs路线图
我只是想知道如何正确使用如何正确使用angularjs路线图,angularjs,routing,Angularjs,Routing,我只是想知道如何正确使用routeParams。 我在app.js中编写了如下代码: .when('/product', { templateUrl: 'views/product.html', controller: 'ProductController', title: '' }) .when('/product/:productId', { templateUrl: 'views/product_detail.html', controller: '
routeParams
。
我在app.js中编写了如下代码:
.when('/product', {
templateUrl: 'views/product.html',
controller: 'ProductController',
title: ''
})
.when('/product/:productId', {
templateUrl: 'views/product_detail.html',
controller: 'ProductDetailController',
title: ''
})
.when('/product/new', {
templateUrl: 'views/product_new.html',
controller: 'ProductController',
title: ''
})
事情是这样的:我想使用名为'/product/new'
但它是“/product/:productId”
。。(product_detail.html
)
我想知道如何同时使用'/product/:productId'
和'/product/new'
有什么方法可以这样布线吗?更改布线顺序:
.when('/product', {
templateUrl: 'views/product.html',
controller: 'ProductController',
title: ''
})
.when('/product/new', {
templateUrl: 'views/product_new.html',
controller: 'ProductController',
title: ''
})
.when('/product/:productId', {
templateUrl: 'views/product_detail.html',
controller: 'ProductDetailController',
title: ''
})
在
/product/:productId
之前更改订单。谢谢!!!它工作得很好。除息的