Skip to content
This repository has been archived by the owner on Dec 30, 2018. It is now read-only.

Implementation error #30

Open
rohit-raj opened this issue Feb 23, 2017 · 0 comments
Open

Implementation error #30

rohit-raj opened this issue Feb 23, 2017 · 0 comments

Comments

@rohit-raj
Copy link

Hi,
Thank you for this library. I am willing to use this library for one of my projects. But during its implementation I am getting numerous console error:
TypeError: element.parents is not a function
TypeError: element.autocomplete is not a function

I use gulp, and have downloaded the autocomplete.js, and used it to bundle autocomplete.js.
I am only using <script> tag to include my gulp generated js files.

my html file :

<textarea class="form-control " ng-model="companyChat.new_comment" marked id="comment"
name="comment" placeholder="Type a message" rows="2" ui-autocomplete="mentionUser">
</textarea>

my controller :

myApp.controller('myController', ['$scope', '$stateParams', '$state', '$timeout', 'authService', '_', 'localStorageService',
    function ($scope, $stateParams, $state, $timeout, authService, _, localStorageService) {
    $scope.mentionUser = {
    options: {
      html: true,
      focusOpen: true,
      onlySelectValid: true,
      source: function (request, response) {
        var data = [
                "Asp",
                "BASIC",
                "C",
                "C++"
        ];
        data = $scope.mentionUser.methods.filter(data, request.term);

        if (!data.length) {
          data.push({
            label: 'not found',
            value: ''
          });
        }
        data.push({
          label: $compile('<a class="btn btn-link ui-menu-add" ng-click="addLanguage()">Add Language</a>')($scope),
          value: ''
        });
        response(data);
      }
    },
    methods: {}
  };
  return $scope;
}]);

any insights will really be of great help @zensh .
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant