首页 > angular在controller里面写数据的时候,如何在父数据里面写一个子数据

angular在controller里面写数据的时候,如何在父数据里面写一个子数据

angular.module('commentContent')
    .controller('commentContentCtrl', [
        function () {
            var ctrl = this;
            ctrl.commentContents = [
                {
                    term: "1111" ,
                },
                {
                    term: "1111" ,
                },
                {
                    term: "1111" ,
                },
                {
                    term: "1111" ,
                },
                {
                    term: "1111" ,
                }
            ];
        }])
        
类似于这样,我写了一个数据,然后我想在每个数据里面再写一个子数据,类似于
angular.module('commentContent')
    .controller('commentContentCtrl', [
        function () {
            var ctrl = this;
            ctrl.commentContents = [
                {
                    term: "1111" ,
                    commentContentTexts = [
                    {
                    time:"1111",
                    }
                    {
                    time:"1111",
                    }
                    {
                    time:"1111",
                    }
                    {
                    time:"1111",
                    }
                    ];
                },
                {
                    term: "1111" ,
                },
                {
                    term: "1111" ,
                },
                {
                    term: "1111" ,
                },
                {
                    term: "1111" ,
                }
            ];
        }])
        这种样子的,请问该如何写,格式是什么呀?
【热门文章】
【热门文章】