1

I have the following scenario:

VF page:

    <div ng-controller="listingGeneratorCtrl">
        <div>
            <div id="rightColumn">
                <div ng-repeat="section in container.Sections">
                    <div ng-model="section">
                        <c:myComponent />
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var mymodule = angular.module("myapp", ['ngSanitize', 'ngRoute']);

        mymodule.controller('myController', 
            function($scope) {

                $scope.container = {};

                $scope.loadContainer = function(id) {
                    myServerController.LoadContainer(id,
                        function(result, event){
                            console.log(result);

                            if(event.status) {
                                $scope.container = result;
                            }
                            else {
                                console.log(event);
                            }
                            $scope.$apply();
                        }
                    );
                };

                angular.element(document).ready(function () {
                    $scope.LoadContainer('{! $CurrentPage.parameters.id }');
                });

                window.__scope = $scope;
            })

VF component "myComponent":

<apex:component>
    <div ng-repeat="element in section.elements">
        <div ng-bind="element.name"></div>
    </div>
</apex:component>

The problem: The data is transmitted correctly from server to client side, however the component is not receiving the data, apparently, because it is rendered empty.

The question: Is there any specific way to bind data to the component? I mean, if component "mycomponent" is under a 'div' with ng-model="section", it must get the value of 'section' variable as the bound data, right? What am I missing here?

Thanks in advance!

1
  • Using your browser's "View Source" or "Inspect" feature to review the overall HTML generated might reveal something - its that HTML that Angular is working against. Commented Nov 6, 2016 at 10:10

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.