Skip to content

Commit

Permalink
Use external templates and html2js preprocessor
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtajina committed Sep 11, 2012
1 parent 44eeddb commit 7b7a0b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
14 changes: 2 additions & 12 deletions js/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,7 @@ tabs.directive('tabs', function() {
transclude: true,
scope: {},
controller: TabsController,
// templateUrl: 'tpl/tabs.html',
template:
'<div class="tabbable">' +
'<ul class="nav nav-tabs">' +
'<li ng-repeat="pane in panes" ng-class="{active:pane.selected}">'+
'<a href="" ng-click="select(pane)">{{pane.title}}</a>' +
'</li>' +
'</ul>' +
'<div class="tab-content" ng-transclude></div>' +
'</div>',
templateUrl: 'tpl/tabs.html',
replace: true
};
});
Expand All @@ -47,8 +38,7 @@ tabs.directive('pane', function() {
link: function(scope, element, attrs, tabsCtrl) {
tabsCtrl.addPane(scope);
},
// templateUrl: 'tpl/pane.html',
template: '<div class="tab-pane" ng-class="{active: selected}" ng-transclude></div>',
templateUrl: 'tpl/pane.html',
replace: true
};
});
2 changes: 1 addition & 1 deletion test/tabsSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('tabs', function() {
beforeEach(module('tabs'));

// load the templates
// beforeEach(module('tpl/tabs.html', 'tpl/pane.html'));
beforeEach(module('tpl/tabs.html', 'tpl/pane.html'));

beforeEach(inject(function($rootScope, $compile) {
// we might move this tpl into an html file as well...
Expand Down
8 changes: 6 additions & 2 deletions testacular.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ files = [
// tests
'test/*.js',

// templates generated by grunt
'tpl/*.html.js'
// templates
'tpl/*.html'
];

// generate js files from html templates
preprocessors = {
'**/*.html': 'html2js'
};

// list of files to exclude
exclude = [];
Expand Down

0 comments on commit 7b7a0b8

Please sign in to comment.