bootstrap popover - ng-repeat within pop-over angular directive -


i trying use boot-strap pop-over within angular. have created directive & trying attach content dynamically using $compile. $compile not replacing contents. here fiddle.

http://jsfiddle.net/gurukashyap/4ajpyjyf/

customdirectives = angular.module('customdirectives', []); function myctrl($scope) {     $scope.items = ['abc','dev','it'];   }      customdirectives.directive('custpopover', function ($compile) {         return {             scope : {                 items : '=items'               },              restrict: 'a',              template: '<span>label</span>',             link: function (scope, el, attrs) {                 scope.label = attrs.popoverlabel;                 var temp = '<ul><li ng-repeat="item in items">{{item}}</li></ul>';                 var contents = $compile(temp)(scope);                 console.log(scope);                 $(el).popover({                     trigger: 'click',                     html: true,                     content:  contents,                     placement: attrs.popoverplacement                 });             }         };     });      angular.module('customcomponents', ['customdirectives']); 

any appreicated

you passed parameter wrong. items: '=newvar'

http://jsfiddle.net/4ajpyjyf/2/


Comments

Popular posts from this blog

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

python - Mongodb How to add addtional information when aggregating? -

java - Incorrect order of records in M-M relationship in hibernate -