directive可以自定义标签和属性,首先看一个例子:
<html ng-app="testModule">
<head>
<meta charset="utf-8">
<title>My HTML File</title>
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="css/bootstrap.css">
<script src="lib/angular/angular.js"></script>
</head>
<body ng-controller="testController">
<input type="text" ng-model="person">
<hello person="person">
<div>
{
{person}}
</div>
</hello>
<p>{
{a}}</p>
<script>
var testModule=angular.module('testModule',[]);
testModule.controller('testController',function($scope){
$scope.person="Tony";
});
testModule.directive('hel