Skip to content

Commit 2c1c766

Browse files
committed
Transclusion
1 parent 8999a28 commit 2c1c766

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

transclusion.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE HTML>
2+
<html>
3+
<head>
4+
<meta http-equiv="content-type" content="text/html; charset=utf-8">
5+
6+
<title>Drink</title>
7+
8+
<link rel="stylesheet" href="vendor/zurb/foundation/stylesheets/foundation.css" type="text/css" media="screen" charset="utf-8">
9+
10+
</head>
11+
12+
<body ng-app="myApp">
13+
14+
<div ng-controller="AppCtrl">
15+
<panel>
16+
<div class="button">My button</div>
17+
</panel>
18+
</div>
19+
20+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.js"></script>
21+
<script src="transclusion.js"></script>
22+
</body>
23+
</html>

transclusion.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
var app = angular.module("myApp", []);
2+
3+
app.controller("AppCtrl", function($scope) {
4+
5+
});
6+
7+
app.directive("panel", function() {
8+
return {
9+
restrict: "E",
10+
transclude: true,
11+
template: '<div class="panel" ng-transclude>This is a panel</div>'
12+
}
13+
});

0 commit comments

Comments
 (0)