Skip to content

Commit 7b7a0b8

Browse files
committed
Use external templates and html2js preprocessor
1 parent 44eeddb commit 7b7a0b8

File tree

3 files changed

+9
-15
lines changed

3 files changed

+9
-15
lines changed

js/tabs.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,7 @@ tabs.directive('tabs', function() {
2323
transclude: true,
2424
scope: {},
2525
controller: TabsController,
26-
// templateUrl: 'tpl/tabs.html',
27-
template:
28-
'<div class="tabbable">' +
29-
'<ul class="nav nav-tabs">' +
30-
'<li ng-repeat="pane in panes" ng-class="{active:pane.selected}">'+
31-
'<a href="" ng-click="select(pane)">{{pane.title}}</a>' +
32-
'</li>' +
33-
'</ul>' +
34-
'<div class="tab-content" ng-transclude></div>' +
35-
'</div>',
26+
templateUrl: 'tpl/tabs.html',
3627
replace: true
3728
};
3829
});
@@ -47,8 +38,7 @@ tabs.directive('pane', function() {
4738
link: function(scope, element, attrs, tabsCtrl) {
4839
tabsCtrl.addPane(scope);
4940
},
50-
// templateUrl: 'tpl/pane.html',
51-
template: '<div class="tab-pane" ng-class="{active: selected}" ng-transclude></div>',
41+
templateUrl: 'tpl/pane.html',
5242
replace: true
5343
};
5444
});

test/tabsSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe('tabs', function() {
55
beforeEach(module('tabs'));
66

77
// load the templates
8-
// beforeEach(module('tpl/tabs.html', 'tpl/pane.html'));
8+
beforeEach(module('tpl/tabs.html', 'tpl/pane.html'));
99

1010
beforeEach(inject(function($rootScope, $compile) {
1111
// we might move this tpl into an html file as well...

testacular.conf.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ files = [
2222
// tests
2323
'test/*.js',
2424

25-
// templates generated by grunt
26-
'tpl/*.html.js'
25+
// templates
26+
'tpl/*.html'
2727
];
2828

29+
// generate js files from html templates
30+
preprocessors = {
31+
'**/*.html': 'html2js'
32+
};
2933

3034
// list of files to exclude
3135
exclude = [];

0 commit comments

Comments
 (0)