Reputation: 2786
Here is my angular code:
angular.module('TM', [])
.controller('protocolCtrl', function(){
this.categoryText = 'Now looking at the protocol part'
})
.controller('categoryCtrl', function(){
this.protocolText = 'Now looking at the category part'
})
.directive('modalDirective', function(){
return {
restrict: 'E',
scope: {
list: '='
},
template: ['<div id="modal" class="modal fade" role="dialog">',
'<div class="modal-dialog">',
'</div>',
'</div>'].join('')
}
});
If I use the template html directly in the HTML file, it shows, but not otherwise.
The mistake is hopefully really minor, but any help is appreciated.
Upvotes: 1
Views: 495
Reputation: 16157
Your code seems fine. But your angular link in your fiddle is broken. When making an Angular JS fiddle you should copy the CDN URL from the Angularjs.org website and add it as your External Resource for JS fiddle.
https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js
Demo:
https://jsfiddle.net/DTcHh/10131/
Upvotes: 2