javascript - ngRepeat is not working in colorbox -
i trying repeat number in array , want output in colorbox, reason can't see the numbers array. not escaping special character or missing concatenation ?
$scope.somenumber = [1,2,3,4]; jquery.colorbox({html:"<div ng-model= 'somenumber' ng-repeat='number in somenumber'>{{number}}</div>"});
inject $compile
controller , like:
jquery.colorbox({html:$compile("<div ng-model= 'somenumber' ng-repeat='number in somenumber'>{{number}}</div>")($scope)});
the reason html has compile in order angularjs retrieve/evaluate expressions , make work properly, otherwise angular can't know happened
Comments
Post a Comment