ionExtendModule.directive('ioeAutoFocus', ['$timeout',
function ($timeout) {
return {
restrict: 'A',
link: function (scope, element, attrs) {
scope.$watch(attrs.ioeAutoFocus, function (value) {
if(value === true){
console.log('value=', value);
$timeout(function () {
element[0].focus();
}, 200);
//scope[attrs.ioeAutoFocus] = false;
}
});
}
};
}]);
网友评论