locked
tElm.is is not a function RRS feed

  • Question

  • User229488726 posted
    I am trying to implement autocomplete textbox using angularjs
    after add js ui-selected2 js it has a error tElm.is is not a function how to solve the problem
    Tuesday, September 6, 2016 1:17 PM

Answers

  • User527778624 posted

    Hi,

    You haven't mentioned jquery file. Jquery is one of the requirements of ui-select2.

    Please add all the required files, check below site:

    https://github.com/angular-ui/ui-select2

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 8, 2016 10:57 AM
  • User-1142886626 posted

    Hi brajalalbrp,

    Firstly, Make sure you have loaded the jQuery file and select-2 reference successful. I suggest you could use F12 developer tool network tab to check if the jQuery file’s indeed load or not. If success will see “200/ok” in the Result/Description column.

    Following link is about how to use it.

    https://msdn.microsoft.com/en-us/library/gg130952(v=vs.85).aspx

    Secondly, with reference to this article, it seems you should add the following references when use the ui-selected2 js.

    <link rel="stylesheet" href="bower_components/select2/select2.css">
    <script type="text/javascript" src="bower_components/jquery/jquery.js"></script>
    <script type="text/javascript" src="bower_components/select2/select2.js"></script>
    <script type="text/javascript" src="bower_components/angular/angular.js"></script>
    <script type="text/javascript" src="bower_components/angular-ui-select2/src/select2.js"></script>
    

    Please check it.

    Best Regards,

    Ailleen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 8, 2016 12:40 PM

All replies

  • User541108374 posted

    Hi,

    can you check if all your .js files get loaded and in the right order? If you double click on the error message in the F12 developer tools console window, or where it appears, can you see where it originates from? If so try to debug as to why it's like that. Did you forget a directive or ...?

    Grz, Kris.

    Tuesday, September 6, 2016 4:07 PM
  • Tuesday, September 6, 2016 5:30 PM
  • User229488726 posted

    Yes all .js files are right order 

    This is my .js fiels 

    <script src="~/Scripts/angular.js"></script>
    <script src="~/Content/AppJS/ui-select2.js"></script>
    <script src="~/Content/AppJS/AllSate.js"></script>

    and this is my error 

    ypeError: tElm.is is not a function
    at Object.compile (http://localhost:2042/Content/AppJS/ui-select2.js:13:31)
    at applyDirectivesToNode (http://localhost:2042/Scripts/angular.js:9149:32)
    at compileNodes (http://localhost:2042/Scripts/angular.js:8543:15)
    at compileNodes (http://localhost:2042/Scripts/angular.js:8555:15)
    at compileNodes (http://localhost:2042/Scripts/angular.js:8555:15)
    at compileNodes (http://localhost:2042/Scripts/angular.js:8555:15)
    at compileNodes (http://localhost:2042/Scripts/angular.js:8555:15)
    at compileNodes (http://localhost:2042/Scripts/angular.js:8555:15)
    at compileNodes (http://localhost:2042/Scripts/angular.js:8555:15)
    at compileNodes (http://localhost:2042/Scripts/angular.js:8555:15) <input type="text" ui-select2="tagAllOptions" class="post-select">(anonymous function) @ angular.js:13920

    Wednesday, September 7, 2016 9:25 AM
  • User527778624 posted

    Hi,

    You haven't mentioned jquery file. Jquery is one of the requirements of ui-select2.

    Please add all the required files, check below site:

    https://github.com/angular-ui/ui-select2

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 8, 2016 10:57 AM
  • User-1142886626 posted

    Hi brajalalbrp,

    Firstly, Make sure you have loaded the jQuery file and select-2 reference successful. I suggest you could use F12 developer tool network tab to check if the jQuery file’s indeed load or not. If success will see “200/ok” in the Result/Description column.

    Following link is about how to use it.

    https://msdn.microsoft.com/en-us/library/gg130952(v=vs.85).aspx

    Secondly, with reference to this article, it seems you should add the following references when use the ui-selected2 js.

    <link rel="stylesheet" href="bower_components/select2/select2.css">
    <script type="text/javascript" src="bower_components/jquery/jquery.js"></script>
    <script type="text/javascript" src="bower_components/select2/select2.js"></script>
    <script type="text/javascript" src="bower_components/angular/angular.js"></script>
    <script type="text/javascript" src="bower_components/angular-ui-select2/src/select2.js"></script>
    

    Please check it.

    Best Regards,

    Ailleen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, September 8, 2016 12:40 PM