xiaoxiao zhang thinks this is interesting: Sometimes it might be interesting to discard the original element, where the directive was attached, replacing it by the directive's template. This can be done by enabling the replace property: From Creating our own directives from AngularJS Essentials by Rodrigo Branas Publisher: Packt Publishing Released: August 2014 Note Replace的是tag本身而不是里面的内容。 Share this highlight http://www.safaribooksonline.com/a/angularjs-essentials/24059/ Twitter Facebook Google Plus Email Get Instant Access Now Start a Free Trial Learn about Safari for Business Have an account? Sign in. Minimise Unlock the rest of AngularJS Essentials and 30,000 other books and videos By clicking this box, you confirm that you have read and agree to the terms and conditions of our Membership Agreement, and you understand that when your trial period ends, you will be required to provide billing information if you wish to continue using the service. Unlock the rest of this book Start a Free 10-Day Trial loading Learn about Safari for Business Have an account? Sign in.