Created
April 15, 2013 05:56
-
-
Save ysyun/5385978 to your computer and use it in GitHub Desktop.
AngularJS Transclude Simple Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Simple transclude sample dom | |
<div ng-app="phoneApp"> | |
<div ng-controller="AppCtrl"> | |
<panel> | |
<div class="button">Click me!</div> | |
</panel> | |
</div> | |
</div> | |
*/ | |
var app = angular.module("phoneApp", []); | |
app.controller("AppCtrl", function($scope) { | |
}) | |
app.directive("panel", function() { | |
return { | |
restrict: "E", | |
transclude: true, | |
template: '<div class="panel" ng-transclude>This is a panel component</div>' | |
} | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment