or
<script id="friendsToInvite-template" type="text/x-kendo-template"> <p class="friendName">#= name #</p> <div style="width: auto; height: 180px; background: url('https://graph.facebook.com/#= fbId #/picture?type=large') no-repeat center;"></div> #if( invited ) {# <p class="friendsButtons"><button class="button2 btn-green unInvite" data-fbid="#= fbId #" data-eventid="#= eventId #">Invited</button></p> #} else {# <p class="friendsButtons"><button class="button2 btn-orange invite" data-fbid="#= fbId #" data-eventid="#= eventId #">Invite</button><!-- /*<button class="button2 btn-grey">Dont show me again</button>*/ --></p> #}# </script>01.app.directive("ibsResizeGraphDirective", ['$window', function ($window) {02. return function (scope, element) {03. //Bind to window resize so that we can have the elements respond.04. //There is no element.resize event and watching for width change doesn't work05. angular.element($window).bind('resize', function () {06. scope.$apply();07. });08. 09. //Watch for element.width() change10. scope.$watch(function () {11. return $(element).width();12. }, function (newValue, oldValue) {13. if (newValue != oldValue) {14. scope.graph.options.chartArea.width = $(element).width();15. // Turn off transitions so that the graphs don't redraw everytime the window changes16. if (oldValue != 0 && scope.graph.options.transitions) {17. scope.graph.options.transitions = false;18. }19. scope.graph.refresh();20. }21. })22. //...23. };24.}]);01.app.directive('ibsChart', [ "ibsMainService", function (ibsMainService) {02. return {03. // Restrict E for element04. restrict: 'E',05. // Here we setup the template for the code we want to replace our directive06. template:"<div ng-show='graph.options.title.text != null' \n\07. ibs-resize-graph-directive \n\08. ibs-owner-warehouse-listener-directive \n\09. ibs-graph-culture-caption \n\10. kendo-chart='graph' \n\11. k-options='chartOptions' \n\12. k-data-source='dataSource' \n\13. class='col-lg-4'/>",14. replace: true,15. scope: { 16. // ...17. },18. controller: function($scope){19. //...20. },21. link: function (scope, element, attrs) {22. //...23. };24.}]);