采用以下代码示例:
app.config( function($stateProvider, $urlRouterProvider, RestangularProvider){
$stateProvider
.state('route1', {
url: "/ID/:slug",
templateUrl: "/static/html/main-view.html",
controller: "CampaignCtrl"
})
etc...
模板main-view.html
只显示项目列表。我现在想在页面中添加简单的注册表单,但是正确的方法(一个例子也很好)。
1) just stick it in the main-view.html, downside is I cannot use it on its own
2) somehow attach another controller no idea how.
3) create a custom directive that accepts prarms to create a form if thats possible.
4) something else?