javascript - Angularjs 多个指令 [gridsection, gridsection] 在 : <div gridsection =""> 上请求模板

标签 javascript angularjs angularjs-directive

我收到错误:Multiple directives [gridsection, gridsection] asking for templateon : <div gridsection="">使用此代码。

我不明白我是如何使用嵌套指令的,也不知道是什么原因造成的。

html页面

<div gridsection ></div>

指令

angular.module('web').directive('gridsection', function() {
    return {
        restrict: 'A',
        replace: false,

        scope: {
      patient: "=patient"
        },
        templateUrl: 'directive/section.html',
        link: function(scope, element, attrs, fn) {


        }
    };
});

指令/section.html

<div>
  here?
</div>

最佳答案

您似乎在 Angular 代码中多次声明了 gridsection。

关于javascript - Angularjs 多个指令 [gridsection, gridsection] 在 : <div gridsection =""> 上请求模板,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25327802/

相关文章:

未找到 Angularjs templateUrl 文件位置

javascript - Angular : dynamic form generation

javascript - 一个字段上的语义 ui 表单验证规则是否可以以不同的字段为条件?

javascript - 将声音添加到标记数组 - google map javascript

css - Angular 和 bootstrap UI 选项卡都处于事件状态以防止默认

javascript - Angular 未定义 Gulp.js

javascript - 我自己的外部 js 代码在 react-router 中工作一次

javascript - 我写的源码有什么问题吗

javascript - 将 ng-repeat 与数组中的键一起使用

angularjs-directive - 使用 Angular js 自定义时间选择器