Skip to content

Instantly share code, notes, and snippets.

@ysyun

ysyun/transclude.js

Created Apr 15, 2013
Embed
What would you like to do?
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