Highcharts-ng
A simple Angularjs directive for Highcharts.
AngularJs, Highcharts
by Ravindra Athreya
HTML
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<div ng-app="sampleapp">
<div ng-controller="samplecontoller">
<div class="focusexample">
<h1>Auto Focus : </h1>
With Out Focus : <input type="text"><br><br>
Auto Focus : <input type="text" focus="true"><br><br>
</div>
</div>
</div>
CSS
.focusexample{
margin:10px 10px;
}
h1{
margin-bottom:10px;
font-size:18px;
}
JavaScript
var myapp = angular.module('sampleapp', [ ]);
myapp.controller('samplecontoller', function ($scope) {
});
// Common directive for Focus
angular.module('sampleapp').directive('focus',
function($timeout) {
return {
scope : {
trigger : '@focus'
},
link : function(scope, element) {
scope.$watch('trigger', function(value) {
if (value === "true") {
$timeout(function() {
element[0].focus();
});
}
});
}
};
}
);