title: AngularJS - Dynamic element is not adding in link function
body: <pre><code>var app = angular.module('myApp', []);
  app.controller('myCtrl', function($scope) {
      $scope.mylist = ["rag", "VJ", "DK", "Lol", "Mangal"];
  });
  
  
  app.directive("myDirective", function($compile){
      return {
          template : "&lt;div&gt;SWESH&lt;/div&gt;",
          restrict: 'EA',
          link: function (scope, element, attrs) {
              var newel = $compile('&lt;select id="customerDD" ng-options="item for item in mylist"&gt;&lt;/select&gt;')(scope);
              element.append(newel);
          }
  
      }
  });
  </code></pre>
  
  <p>Trying to add dynamic elements in angular custom directive, it is not working</p>