Skip to content

Instantly share code, notes, and snippets.

@ysyun
Created April 15, 2013 05:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysyun/5385978 to your computer and use it in GitHub Desktop.
Save ysyun/5385978 to your computer and use it in GitHub Desktop.
AngularJS Transclude Simple Sample
/*
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