AngularJS: JS Fiddle 加载资源失败

AngularJS: JS Fiddle Failed to load Resource

Fiddle

这是我的 angular 代码:

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('')
    }
});

如果我直接在 HTML 文件中使用模板 html,它会显示,但不会显示。

希望这个错误真的很小,但感谢您的帮助。

您的代码看起来不错。但是你的 angular link 在你的 fiddle 中坏了。在制作 Angular JS fiddle 时,您应该从 Angularjs.org 网站复制 CDN URL 并将其添加为 JS fiddle.[=13 的外部资源=]

https://ajax.googleapis.com/ajax/libs/angularjs/1.4.3/angular.min.js

演示:

https://jsfiddle.net/DTcHh/10131/