Skip to content

Commit 45dc8a6

Browse files
committed
add branch 'templateUrl'. Extracted internal directive template into an external template page
1 parent f7303ca commit 45dc8a6

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

egghead/js/app.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ app.directive('zippy', function() {
99
attrfoo: '@',
1010
attrbar: '@'
1111
},
12-
template: '<div>' +
13-
'<h3 ng-click="toggleContent()"> First input is: {{attrfoo}} </h3><br/>' +
14-
'Second input is: {{attrbar}} <br/>' +
15-
'<div ng-click="myFunc()" ng-show="isContentVisible" ng-transclude> </div>' +
16-
'</div>',
12+
templateUrl: 'templates/zippy_template.html',
1713

1814
link: function(scope) {
1915
scope.isContentVisible = false;
@@ -24,7 +20,7 @@ app.directive('zippy', function() {
2420
};
2521

2622
scope.myFunc = function() {
27-
console.log('myfunct Fired')
23+
console.log('myfunct Fired');
2824
};
2925
}
3026
};

egghead/templates/zippy_template.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div>
2+
<h3 ng-click="toggleContent()"> First input is: {{attrfoo}} </h3><br/>
3+
Second input is: {{attrbar}} <br/>
4+
<div ng-click="myFunc()" ng-show="isContentVisible" ng-transclude> </div>
5+
</div>

0 commit comments

Comments
 (0)