angularjs向页面添加表单

时间:2013-11-23 18:09:45

标签: javascript angularjs

采用以下代码示例:

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?

0 个答案:

没有答案