Reputation: 109
Hi i need to use the 'keypress' event from the angular ui utils library. But, I am unable to include angular ui in my project. I have already tried this- How to integrate AngularUI to AngularJS?
Although, the jsfiddle posted in comments of that answer works, but it didn't work for me in sublime text. I can't understand why. I request someone to give a proper way to include angular ui and use ui-utils. Please try your method on a local text editor before posting answer.
Upvotes: 0
Views: 629
Reputation: 109
Okay, I figured it out somehow! Add this code to your project:
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.0/jquery-ui.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui/0.4.0/angular-ui.min.js"></script>
Make a myApp.js file with the following code:
var myApp = angular.module('myApp',['ui.directives']);
The 'ui.directves' part can be changed for whatever you want to use. Eg. 'ui.events' (which I will be using). Also, add
<script type="text/javascript" src="myApp.js"></script>
below all the links preferably. You're good to go!
Upvotes: 2