title: append text field and make it auto complete using jquery
body: <p>app.js </p>
  
  <pre><code>$scope.add = function () {
    $('#btn').click(function() {
    // insert a SPAN tag with class="spn" at the end in all DIVs with      class="cls"
       $scope.data=[];
       var add=' &lt;input type="text" name="currency" id="autocomplete"&gt;' ;
       $('div.cls').append(add);
       i++;
       $scope.count++;
    });
  }
  
  $scope.autocomplete=function(){
    var currencies = [
      { value: 'Afghan afghani' },
      { value: 'Albanian lek'},
      { value: 'Algerian dinar'},
      { value: 'European euro' }
    ];
  
    // setup autocomplete function pulling from currencies[] array
    $('#autocomplete').autocomplete({
      lookup: currencies,
    });
  }
  </code></pre>
  
  <p>html</p>
  
  <pre><code>&lt;div class="cls" id="idd"&gt;&lt;/div&gt;
  &lt;button type="button" class="btn btn-default btn-sm" id="btn"&gt; 
    &lt;span class="glyphicon glyphicon-plus"&gt;&lt;/span&gt; Add
  &lt;/button&gt;
  </code></pre>
  
  <p>This auto complete function run without using as append.. but when i used it after appending text field like above it does not works.can anyone help me.</p>