app.directive("topscroll", function($timeout){
return {
restrict: "A",
scope:{
watchdata:"="
},
link: function(scope,element){
var el = element[0];
function scrollToTop(){
element.ready(function () {
el.scrollTop = 0;
});
}
scope.$watch("watchdata",function(){
scrollToTop();
},true);
}
};
});