I have the following code:
elem.bind('keydown keyup keypress', function(event) {}
I use keydown, keyup, keypress event. and want to add load event. how do I add load event?
I have the following code:
elem.bind('keydown keyup keypress', function(event) {}
I use keydown, keyup, keypress event. and want to add load event. how do I add load event?
angular("mymodule").directive( 'onReady', function( $parse ) {
return {
restrict: 'AE',
link: function( $scope, elem, attrs ) {
elem.ready(function(){
$scope.$apply(function(){
var func = $parse(attrs.onReady);
func($scope);
})
})
}
}
})
use it like
<div on-ready="mymethod()"></div>
where mymethod is ur function in controller