Angular ui-router: ui-views vs directives?

后端 未结 4 1062
陌清茗
陌清茗 2020-12-12 14:35

The angular ui-router allows multiple nested views. The role of these interchangeable views seems to overlap the role of directives.

What are the pros/cons

4条回答
  •  死守一世寂寞
    2020-12-12 14:47

    **In Config function:**
    .state('list', {
                url:'/list',
                template:'',
                controller:'UserInfoTableController',
            });
    
    **In Directive:**
    angular.module('UserInfo').directive("userInfoTable", function() {
        return {
           templateUrl:'templates/UserInfoTable.html',
           restrict:'EA',
        };
    });
    

提交回复
热议问题