<!doctype html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://apps.bdimg.com/libs/angular.js/1.3.9/angular.min.js"></script>
</head>
<body >
<div><hello>22<hello></div>
</body>
<script>
var myApp=angular.module('myApp',[]);
myApp.directive('hello',function(){
return {
restrict:'AE',
template:'<div>hello angularJS</div>',
replace:true
}
});
</script>
</html>
angular之directive模板视图替换
最新推荐文章于 2021-12-05 08:45:00 发布