Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 在角度指令中使用PRISMJ_Angularjs - Fatal编程技术网

Angularjs 在角度指令中使用PRISMJ

Angularjs 在角度指令中使用PRISMJ,angularjs,Angularjs,我正在尝试在我的angular应用程序中使用 在左边你看到了我得到的,在右边你得到了预期的结果 下面你可以看到我正在使用的代码。 以下是我使用的指令: (function () { 'use strict'; function prism() { return { restrict: 'A', link: function($scope, element, attrs) { ele

我正在尝试在我的angular应用程序中使用

在左边你看到了我得到的,在右边你得到了预期的结果

下面你可以看到我正在使用的代码。 以下是我使用的指令:

(function () {
    'use strict';

    function prism() {
        return {
            restrict: 'A',
            link: function($scope, element, attrs) {
                element.ready(function () {
                    Prism.highlightElement(element[0].querySelector('code'));
                });
            }
        };
    }

    angular.module('app.directives').directive('prism', prism);

})();

有人知道我可能做错了什么吗?

好吧,我发现了我的问题,显然没有逃脱,所以加上它确实解决了问题