angular.js - ng 自动获取焦点
PHPz
PHPz 2017-05-15 17:07:40
0
1
1008

input自动获取焦点目前使用js完成,怎么用ng写?

PHPz
PHPz

学习是最好的投资!

reply all(1)
刘奇

My idea is to write an instruction and then attach the instruction to the input

var myApp = angular.module('myApp',[]);
    myApp.directive('autoFocus', function(){
          return function(scope, element){
            element[0].focus();
          };
    });
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!