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!