input自动获取焦点目前使用js完成,怎么用ng写?
学习是最好的投资!
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(); }; });
My idea is to write an instruction and then attach the instruction to the input