AngularJs ng-repeat in Yii2 Grid column

154 Views Asked by At

I need to embed a small HTML snippet in a column of a Yii2 GridView. The HTML contains angular directives (i.e., ng-repeat). Here is the GridView column:

                [
                    'label' => 'Column',
                    'format' => 'html',
                    'value' => function ($model) {
                        $return = '';
                        $return.= '<div ng-repeat="el in elements">';
                        $return.= '<h4>El Title: {{el.title}}</h4>';
                        $return.= '</div>';

                        return $return;
                    }
                ],

The GridView is inside an angular controller that should compile it when the page is rendered. However, the ng-repeat loops is ignored, while the {{el-title}} expression is evaluated empty (which tells me that angular compiled {{el.title}} but could not deal with the ng-repeat. Any suggestion?

0

There are 0 best solutions below