I have the code in my html file
<!doctype html>
<html ng-app="slider">
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
<script type="text/javascript" ng:autobind src="http://code.angularjs.org/0.10.5/angular-0.10.5.min.js"></script>
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/redmond/jquery-ui.css" rel="stylesheet" />
<script src="app.js"></script>
</head>
<body>
<div jq:slider></div>
<input id="amount" />
{{years}}
</body>
</html>
And my app.js is this
angular.module('slider',[])
.directive('jq:slider', function() {
return function(elm) {
var currentScope = this;
elm.slider({
range: true,
min: 0,
max: 500,
values: [ 75, 300 ],
slide: function( event, ui ) {
$( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
currentScope.years = ui.values[0];
currentScope.$apply();
}
});
};
});
For some reason when I run this code I get the following error:
Uncaught TypeError: Object # has no method 'module'
I've tried this same code with out having a module and an external file and it works just fine... any clues?
Err... I think that elm.slider
is undefined....