Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

angularjs directive recursion perfomace issue #3079

Closed
@RobinHan126

Description

@RobinHan126

directive:

.directive("layoutParser", function(){
        return { 
            template : layout.html,
            replace  : false,
            transclude : false,
            restrict : "A",
            scope : {
                rows : "=descriptor"
            }
        }
     }) 

layout.html

<div class="row-fluid" ng-repeat="row in rows">
    <div ng-repeat="block in row" ng-switch on="block.form" class="span{{block.span}}">
        <div ng-switch-when="layout">
            <div layout-parser descriptor="block.rows">{{block.id}}</div>
        </div>          
        <div ng-switch-when="panel">
            <div>{{block.title}}</div>
        </div>
        <div ng-switch-default>

        </div>
    </div>  
</div>

model:

"layout": {
        "rows": [[{
            "form": "panel",
            "id": "panel1",
            "span": "12"
        }],
        [{
            "form": "panel",
            "id": "panel2",
            "span": "6"
        },
        {
            "id": "layout1",
            "form": "layout",
            "span": "6",
            "rows": [[{
                "form": "panel",
                "id": "panel4",
                "span": "6"
            },
            {
                "form": "panel",
                "id": "panel5",
                "span": "6"
            }]]
        }]]
    }

invocation page codes:

 <div layout-parser descriptor="layout.rows"> </div>   

issue:
when the above codes ruining explore will very slow and popup a warning dialog,
such as Infinite loop JavaScript codes executed by explore.

i guess that is angularjs issue, please give me some idea.

thanks
Robin

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions