0

Select2 of the Angular-UI in Bootstrap navigation bar is giving error

TypeError: Object [[object HTMLInputElement]] has no method 'is'

Please refer to the http://plnkr.co/edit/yCG5M9

2
  • please explain your answer in more detail. Commented Dec 6, 2012 at 14:15
  • @jm-'s answer is correct. I've added an explanation to his post. Commented Dec 6, 2012 at 20:53

1 Answer 1

1

You need to load jQuery before AngularJS

Just change the order to

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.0.3/angular.min.js"></script>

EDIT (blesh): This is because if angular doesn't see JQuery as it's loading, then the tElm (angular element) argument being passed into that compile function is a jqLite object. If Angular sees JQuery has been loaded first, the tElm will be a full JQuery object, and is() will be available.

Sign up to request clarification or add additional context in comments.

2 Comments

This is the correct answer, I just added an explanation of why it's the correct answer.
But After changing the order of the script import Bootstrap navigation collapse does not work. The collapse button that comes for responsive design does not work. Please see the updated link plnkr.co/edit/yCG5M9

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.