【发布时间】:2015-09-15 21:22:05
【问题描述】:
我可以使用 stateParams 在父控制器中设置值 - 但想在该控制器中调用函数。我是否需要在孩子的“resolve:”或“onEnter:”属性中添加一些东西来调用父母控制器中的函数。注意:子状态没有任何模板,因为它们将使用父模板。
myApp.config(function($stateProvider) {
$stateProvider
.state('reports', {
url: "/reports",
templateUrl: "reports.parent.template.html",
controller: "ReportsController",
controllerAs: "reports"
})
.state('reports.users', {
url: "/users",
reportSettings: {
title: "Active Users Report",
reportName: "UserList.trdx"
}
})
.state('reports.departments', {
url: "/departments",
reportSettings: {
title: "Active Departments Report",
reportName: "DepartmentList.trdx"
}
})
});
【问题讨论】:
标签: angularjs angular-ui-router