Skip to content

Commit 22dc12f

Browse files
author
K.C. Hunter
committed
Adding Transclusion tutorial
1 parent 3ae3b10 commit 22dc12f

7 files changed

Lines changed: 74 additions & 2 deletions

File tree

GruntFile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ module.exports = function (grunt)
4646
},
4747
styles: {
4848
files: ['src/resources/css/*.scss'],
49-
tasks: ['sass']
49+
tasks: ['sass:dev', 'concat:css']
5050
}
5151
}
5252
});
@@ -64,6 +64,6 @@ module.exports = function (grunt)
6464

6565
grunt.registerTask('build', 'Build the application',
6666
['sass:dev',
67-
'concat'
67+
'concat:dist', 'concat:css', 'concat:move'
6868
]);
6969
}

src/angularjstutorial.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,16 @@ app.controller('MainController', function ($scope)
9595
}
9696
}
9797
}
98+
})
99+
100+
/* use strict */
101+
.directive("buttonDirective", function ()
102+
{
103+
return {
104+
restrict: 'AE',
105+
transclude: false,
106+
template: '<button class="btn btn-primary" type="button">' +
107+
'Accio Code <data-ng-transclude></data-ng-transclude>' +
108+
'</button>'
109+
}
98110
})

src/resources/css/angularjstutorial.css

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/css/styles.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@ html, body {
33
height: 100%;
44
padding: 0;
55
margin: 0; }
6+
7+
.panel-success {
8+
color: #d81e05;
9+
background-cikir: #dff0d8;
10+
padding: 14px 8px;
11+
font-size: 1.55em; }

src/resources/css/styles.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ html, body {
44
padding: 0;
55
margin: 0;
66
}
7+
8+
.panel-success {
9+
color: #d81e05;
10+
background-cikir: #dff0d8;
11+
padding: 14px 8px;
12+
font-size: 1.55em;
13+
}

src/resources/js/transclude.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* use strict */
2+
.directive("buttonDirective", function ()
3+
{
4+
return {
5+
restrict: 'AE',
6+
transclude: false,
7+
template: '<button class="btn btn-primary" type="button">' +
8+
'Accio Code <data-ng-transclude></data-ng-transclude>' +
9+
'</button>'
10+
}
11+
})

src/transclude.html

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
5+
<title>AccioCode AngularJS Tutorial</title>
6+
<meta charset="utf-8">
7+
<meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1">
8+
<meta name="viewport" content="width=device-width, user-scalable=no">
9+
<script src="angularjstutorial-deps.js"></script>
10+
<script src="angularjstutorial.js"></script>
11+
12+
<link rel="stylesheet" href="resources/css/angularjstutorial.css">
13+
</head>
14+
15+
<body>
16+
<div class="mainContainer" data-ng-app="MyApp">
17+
18+
<h1>Features</h1>
19+
<h2>Transclude</h2>
20+
21+
<button-directive>
22+
<span class="badge">&copy; 2014</span>
23+
</button-directive>
24+
25+
26+
27+
</div>
28+
29+
</body>
30+
</html>

0 commit comments

Comments
 (0)