angular 常用指令.doc

angular 常用指令

angular 常用指令 已经用了angular很久积累了一些很实用的指令,需要的话直接拿走用,有问题大家一起交流 1.focus时,input:text内容全选 angular.module(my.directives).directive(autoselect, [function () { return { restrict: A, link: function (scope, element, attr) { if (element.is(input) attr.type === text) { var selected = false; var time = parseInt(attr[autoselect]); element.bind(mouseup, function (e) { if (selected) { e.preventDefault(); e.stopPropagation(); }

文档评论(0)

1亿VIP精品文档

相关文档