angularjs如何实现通知条
发布网友
发布时间:2022-04-23 03:37
我来回答
共1个回答
热心网友
时间:2022-04-23 05:06
可以写个指令:
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<title>angularjs-focus</title>
</head>
<body>
<input type="text" set-Focus="">
<script type="text/javascript" src="js/angular.min.js"></script>
<script type="text/javascript">
var myApp = angular.mole('myApp',[]);
myApp.directive('setFocus', function(){
return function(scope, element){
element[0].focus();
};
});
</script>
</body>
</html>