我对 Angular 很陌生,但很喜欢它!我正在尝试创建一个模式对话框来显示部分视图。ui.bootstap.modal 有一个选项,它将 URL 带到要显示的局部视图。我在我的应用程序模块上配置了一个路由,如下所示:
angular.module('buggy').config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/lists', {
templateUrl: 'views/lists/list.html'
}).
when('/lists/create', {
templateUrl: 'views/lists/create.html'
}).
when('/lists/:listId', {
templateUrl: 'views/lists/partials/view.html'
}). //more stuff
我想展示when(/lists/:listId)
从上述路线定义的部分模板。所以在我的控制器中,我试图打开模态对话框,如下所示:
$scope.showList = function (list) {
$modal.open({
templateUrl:'lists/' + list._id,
scope:$scope
});
}
模式对话框打开,但内容只是[object]
. 我需要在服务器端定义路由还是可以使用 Angular 路由返回部分路由?
谢谢!